fatfree icon indicating copy to clipboard operation
fatfree copied to clipboard

CMS Demo does not work on PHP 7.4

Open BlackGrizzly opened this issue 4 years ago • 7 comments

CMS Demo does not work on PHP 7.4 - ERROR 500

BlackGrizzly avatar Feb 28 '20 10:02 BlackGrizzly

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

pauljherring avatar Feb 28 '20 10:02 pauljherring

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

BlackGrizzly avatar Feb 28 '20 11:02 BlackGrizzly

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                  );

pauljherring avatar Feb 28 '20 11:02 pauljherring

I use f3-3.0.6.cms.demo

BlackGrizzly avatar Feb 28 '20 11:02 BlackGrizzly

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

wfsdaj avatar Aug 05 '20 02:08 wfsdaj

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?

n0nag0n avatar Sep 10 '20 04:09 n0nag0n

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

eydun avatar Aug 16 '21 14:08 eydun