bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMS Demo does not work on PHP 7.4

BlackGrizzly opened this issue · comments

CMS Demo does not work on PHP 7.4 - ERROR 500

commented

You appear to have left out the bit of your webserver's error log which gives the reason for that 500...

Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: PHP Fatal error: Uncaught ErrorException: Trying to access array offset on value of type null in ../lib/base.php:1448
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: Stack trace:
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: #0 ../lib/base.php(859): Base->{closure}(8, 'Trying to acces...', '...', 859, Array)
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: #1 ../lib/base.php(1442): Base->error(500, 'Trying to acces...', Array)
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: #2 [internal function]: Base->{closure}(Object(ErrorException))
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: #3 {main}
[Fri Feb 28 14:01:56 2020] [warn] [client 62.176.11.209] mod_fcgid: stderr: thrown in ../lib/base.php on line 1448

commented

What version of cms demo are you using? 3.0.6 doesn't seem to match up with those line numbers:

  1440                  set_exception_handler(
  1441                          function($obj) use($fw) {
  1442                                  $fw->error(500,$obj->getmessage(),$obj->gettrace());
  1443                          }
  1444                  );
  1445                  set_error_handler(
  1446                          function($code,$text) use($fw) {
  1447                                  if (error_reporting())
  1448                                          throw new ErrorException($text,$code);
  1449                          }
  1450                  );

I use f3-3.0.6.cms.demo

PHP 5.6, 7.2, 7.3 版本都无法运行,提示 500 错误。

So this is probably pretty old, but I remember using the CMS demo and trying to get it to work and I ran into the same issue. The way I got it fixed was I updated the FatFree composer package to the latest (I think it was 3.7 or 3.7.1 at the time) and the 500 issue went away. Maybe that will solve it for you as well?

commented

I run the CMS-demo on PHP Version 8.0.7, and it works great.