Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

error handling - How do I avoid " PHP Strict Standards" if I cannot change the version of my PHP (PHP 5)

Here are some examples to some of the errors. I heard this is a result of old code in new code, but I can't change my PHP version off the native 5.4 version ispmanager uses because I need Apache. Tried switching version but it messes up my site. Any ideas?



PHP Strict Standards:  Redefining already defined constructor for class Object in /var/www/ku/data/www/Public IP/cake/libs/object.php on line 54, referer: http://Public IP/posts/add


PHP Strict Standards:  Non-static method Configure::getInstance() should not be called statically in /var/www/ku/data/www/Public IP/cake/bootstrap.php on line 38, referer: http://Public IP/posts/add


PHP Deprecated:  Assigning the return value of new by reference is deprecated in /var/www/ku/data/www/Public IP/cake/libs/cake_log.php on line 182, referer: http://Public IP/posts/add```
question from:https://stackoverflow.com/questions/65919115/how-do-i-avoid-php-strict-standards-if-i-cannot-change-the-version-of-my-php

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

adding this in your PHP code may solve your problem.

error_reporting(0);
#this will display no errors.

error_reporting(E_ALL ^ E_STRICT);
#this will make it just not strict

Is this what you need?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...