I am getting following errors after updating php to version 5.4
Strict Standards: Non-static method Debugger::invoke() should not be called statically, assuming $this from incompatible context in /usr/share/php/cake/libs/debugger.php on line 575
Strict Standards: Non-static method Debugger::getInstance() should not be called statically, assuming $this from incompatible context in /usr/share/php/cake/libs/debugger.php on line 575
I have already tried following solutions
Error while Disabling error reporting in CakePHP
Cakephp doesn't work after installing php5-curl package (Unable to locate "Cake" folder as I have baked my project)
Wampserver cakephp 1.3 Strict standards error
How to eliminate php5 Strict standards errors?
PHP 5 disable strict standards error
https://stackoverflow.com/questions/11799085/turn-off-php-strict-standards?lq=1 (Was not able to turn off the errors)
Cleared cake cache, web browser cache, cookies and restarted server after each change. Even tried in private browsing and chrome, firefox, ie also.
I believe this is because this app is built on an older version of CakePHP, which may use some deprecated functions.
It'd be awesome if you (or someone else) could upgrade Cake to a new stable branch.
As of now try this in your core.php you could remove the E_STRICT from your error reporting:
i.e go to app/Config/core.php find
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
replace it as
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_STRICT & ~E_DEPRECATED,
'trace' => true
));
Changing the error_reporting function does work to fix this. However, cakephp seems to set these flags in several places, that's why the solution may not have worked for you (I went through the same)
Do a source-wide search for "error_reporting" and you'll find it used in several files. Add the flag "~E_STRICT" wherever you can. For instance:
error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
You'll see it in places like /cake/bootstrap.php, /cake/libs/configure.php, /cake/console/cake.php, etc. I just changed them all to exclude E_STRICT and the problem was fixed.
Related
So, I have been asked by a family friend to take a look at their site. It has just recently turned into a big garbled mess of errors such as;
Strict Standards: Non-static method JLoader::import() should not be called statically in /home/sitename/public_html/libraries/joomla/import.php on line 29
Strict Standards: Non-static method JLoader::register() should not be called statically in /home/sitename/public_html/libraries/loader.php on line 71
Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in /home/sitename/public_html/libraries/joomla/environment/request.php on line 462
I have been looking elsewhere and I have seen mention of changing error_reporting in configuration.php, I have changed it from
var $error_reporting = '-1';
to
var $error_reporting = '6135';
This removed a lot of the errors that was appearing on the page but there is still plenty that exist. Can anyone help me with clearing up the last lot of errors?
From what I can gather, the site is Joomla 1.5 which I know needs to be updated but if I can just get the errors to 'disappear' whilst I can work on updating the site or getting a new one built that would be great!
Thanks
Add $error_reporting = 22516 if you are using PHP 5.4.x
Add $error_reporting = 22519 if you are using PHP 5.3.x
Add $error_reporting = 6133 if you are using PHP 5.2.x
And if you have php.ini access, find error_reporting and assign E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
IF doesn't work
in your index.php after define( '_JEXEC', 1 ); add error_reporting(0); if not work, replace with error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); Also, after each change if not work, check the error_reporting value in info page.
OR if you don't want to see any error, contact your host to disable display_errors or if you have access to php.ini then do that yourself.
I know there's a LOT of stuff written here about this but we're running a CakePHP 1.3 on the newest PHP version on our Debian server. Right now there's multiple people using the system and I just had to delete a 17GB error.log from the server. It keeps pushing PHP Strict Standards error messages to it even though I've supressed the messages from the CakePHP /cake/bootstrap.php by adding the ~E_STRICT and I've thought about adding this..
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED & ~E_STRICT,
'trace' => true
));
.. to the /app/core.php but I'm afraid to go do it on a live operation.
Why cannot I suppress these messages from the bootstrap.php or is the core.php the only way even though the Configure::write('Error'), array()); is commented out in there?
Configure::write('log', E_WARNING);
This would log only warning and fatal errors. If you want to disable error logging, this should work:
Configure::write('log', false);
I am running CakePHP 1.2.9 on my xampp server 1.8.2 with PHP version 5.4.19.
But I am getting some errors like
Strict Standards: Redefining already defined constructor for class Object in C:\xampp\htdocs\PROJECT_NAME\cake\libs\object.php on line 62
Strict Standards: Non-static method Configure::getInstance() should not be called statically in C:\xampp\htdocs\paris-clone\cake\bootstrap.php on line 46
I tried to figure this out with this, but not succeeded.
please help me with it.
Thanks
Since PHP 5.4 E_STRICT is included in E_ALL. Maybe CakePHP 1.x doesn't know of E_STRICT setting ?
http://php.net/manual/en/function.error-reporting.php
Change logging in your application to display only errors:
'level' => E_ERROR | E_WARNING | E_PARSE,
Or set in in php.ini.
You might also want to set level debug to disable error displaying on production mode in the first place. In cakephp 2 it is achieved by setting debug var in core.php:
Configure::write('debug', 0);
I am having an issue with my business website, and it keeps giving me the following errors on my website and login:
Strict Standards: Accessing static property JCache::$_handler as non static in /home/doveheal/public_html/libraries/joomla/cache/cache.php on line 422
Also on my website is this error:
Strict Standards: Only variables should be assigned by reference in /home/doveheal/public_html/plugins/content/jw_allvideos/jw_allvideos.php on line 42
I have seen many tutorials on how to fix it via changing the strict standard settings in XAMPP, but this does not apply to me as I do not use XAMPP. Truth be told, I did not create the website (someone else did and it was handed to me), and I am really struggling to figure out how to solve this problem.
Any help would be appreciated!
You will on your localhost (Xampp) have access to the php.ini file. Open it and search for:
error_reporting =
There will be a value after the = which you need to change to:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
Once changed, make sure you restart Apache.
This is however somethign you should flag to the developer of jw_allvideos so they can fix it.
Hope this helps
I (like a lot of others) am seeing Strict Standards errors with PHP 5.4.???.
Strict Standards: Only variables should be passed by reference in /home/xxxxxx/public_html/xxxxxx/init.php on line 64
There must have been a change between 5.3 and 5.4. All the "wisdom" on the Internet seems to be about turning the error messages off. In this case this is a program (1,000's of lines written by someone else) that I am disinclined to try to resolve.
If I turn off the error reporting then the script does not execute.
I am trying to work the issue with the writer of the script.
Is there any other solution? Is there a setting that can be placed in the .htaccess file that will allow "non strict standards"?
You need to go into your php.ini file and assign the following:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
This will allow you to show all warnings except deprecated & non-strict standards.
If you want to fix the error rather than ignore it (recomended):
$uri = explode("/",$_SERVER['REQUEST_URI']);
define("INSTALL_URL" , $protocall.$host_name . str_replace("/".array_pop($uri),"/",$_SERVER['REQUEST_URI']));