Problem with E_STRICT after server move

Permalink 1 user found helpful
I have a weird problem with E_STRICT errors after moving servers and updating PHP.

We are running PHP 5.4.3.

When accessing the site I get the following error:
Strict Standards: Non-static method Cache::get() should not be called statically


I have edited php.ini and changed the settings to:
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off

But I still get the errors.

The weird thing is that if use:
<?php
   echo ini_get('error_reporting'); 
   echo ini_get('display_errors'); 
?>


outside of concrete5, I get 24567 but If I add those lines to my template in concrete5, I get 245671.

Seems like Concrete5 is setting display_errors to 1 even though they are hidden in php.ini.

Where can I change this?

Hypocrite
View Replies:
Hypocrite replied on at Permalink Reply
Hypocrite
I found the following information related to this:
http://serverfault.com/questions/375992/hide-strict-errors-on-php-5...

According to that site in PHP 5.4 E_STRICT is now part of E_ALL.

But that setting did not help.

I think the problem is that concrete5 is setting E_ALL when my site is in development mode. And that is a problem with PHP 5.4 because E_STRICT is now part of E_ALL.

Any suggestions?

UPDATE: I was running C5 5.5.1. Noticed that this might be fixed in newer versions of C5.
Hypocrite replied on at Permalink Reply
Hypocrite
Upgrading to 5.5.2.1 fixed all the errors.
ebchang replied on at Permalink Reply
I am having the same problem. Version is 5.2.1. We just moved to a new server with PHP 5.4.

My question is, how can I update if I can't load the site and get to the dashboard?

I am guessing that trying to call index.php/tools/required/upgrade will have the same errors. Is that correct? I am reluctant to experiment too much until I am sure what will work.
Hypocrite replied on at Permalink Reply
Hypocrite
1. Download Concrete5 5.5.2.1.
2. Rename the /concrete/ folder from root to for example /concrete_bak/.
3. Upload the new /concrete/ folder to your FTP site.
4. Then run the upgrade script fromhttp://www.yoursite.com/index.php/tools/upgrade.php...
afixia replied on at Permalink Reply
afixia
I have a similar situation now that my servers are on 5.4.5, though my errors are not on the front end. They are being logged properly, but since there are multiple STRICT errors on each page being loaded, my php error log is growing at a super fast rate. I had a error log up to 1 gig from one night as we run about 50 Concrete5 sites on our servers. I see in the debug_logging.php there it sets the site's error reporting like so:

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
$debug_level = Config::get('SITE_DEBUG_LEVEL');
switch($debug_level) {
   case DEBUG_DISPLAY_ERRORS:
      if(defined("E_DEPRECATED")) {
         error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); // E_DEPRECATED required for php 5.3.0 because of depreciated function calls in 3rd party libs (adodb).
      } else {
         error_reporting(E_ALL ^ E_NOTICE);
      }
      ini_set('display_errors', 1);
      break;
   default:
      if(defined("E_DEPRECATED")) {
         error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);


So every site, my ini's settings are being overwritten by Concrete5, and it would kinda stink to go through every new install and every existing install to change this page's code. Does anyone have any ideas on how to override Concrete5's PHP code in the php.ini?