Blank page after update to PHP 5.4
  • We have Newscoop 4.3.2 running on PHP 5.3. When I update the server to PHP 5.4 or 5.5 the site stops working and only shows a blank and empty page.

    I cleared the cache after updating, but that didn't help and there are no errors in the logs.

    How can I fix this?
  • 9 Comments sorted by
  • From my colleague Victor:

    Maybe some PHP module was left out after the upgrade. Since we are getting just a blank page, and you say that there are no errors in the logs, I would suggest enabling error display in PHP's configuration, so we can get some hint about the cause. Please do that and let me know whether you get any errors this time.
  • As via email a week ago:

    The site is running on a shared platform on which we can switch between PHP versions. All modules are linked to that, so it is unlikely that one module was left behind.

    How do you enable the debug setting in Newscoop?
    Post edited by Roelof at 2015-08-25 09:12:23
  • Are there to error in the file <newscoop_path>/log/prod.log? Usually serious errors are reported there.

    Enabled dev mode for newscoop:
    1. Update composer to install dev dependencies (run this in the newscoop install directory where the composer.json file is located): php composer.phar update
    2. Add this to you Apache vhost configuration: SetEnv APPLICATION_ENV "development"
    3. Restart apache 
    If you visit your website now it should run in dev mode and have advanced error messages and a toolbar at the bottom of the page, with some statistics.
  • The log/prod.log shows nothing when changing to PHP 5.4.
    I also see an old log/dev.log from the last time I had blank page troubles, but I forgot how to 'turn that on'.

    I will see on how to set the vhost config.
  • The file log/dev.log will be used when Newscoop is running in development mode, as described above. This should be more verbose and hopefully lead us to the solution.
  • I found that you can also enable it by putting that in the .htaccess.

    I now get the following error instead of a blank page:

    "Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in /domains/gfmd.info/DEFAULT/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php on line 40"

    And in the log/dev.log I get a lot of "[....] event.DEBUG: Notified event "kernel.request" to listener [...]" errors
  • It seems you are using APC as a caching mechanism. It seems that the APC extensions for PHP is not enabled, because you are getting an error about a missing function. Please check this.

    Alternatively you could revert to using caching via array or xcache. Xcache would require the xcache extension to be installed. You can change this in the Newscoop backend, by going to System Preferences > Cache Setting > Database Cache Engine.
    If you can't access the backend, you can also change it in the database. Go to the tabl SystemPreferences and search in the field varname for DBCacheEngine. Change the value there to either NULL (for array) or xcache. Don't forget to clear 
    contents of the cache folder afterwards.

    Ps the lines event.DEBUG: Notified event "kernel.request" to listener can be ignored. They are just debug statements about all events called.
  • Thanks! I enabled the APC extensions and that seems to fix the blank page. So the site is now running on PHP 5.4. 
  • Issue resolved.