简体   繁体   中英

PHP - Strict Standards error with 5.4.?

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['RE‌​QUEST_URI']));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM