1
votes

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"?

2
You basically have two options: fix the errors or turn the strict error messages off (with error_reporting(E_ALL ^ E_STRICT), for example).raina77ow
By the way...the line of code is a messy affair like this: define("INSTALL_URL" , $protocall.$host_name . str_replace("/".array_pop(explode("/",$_SERVER['REQUEST_URI'])),"/",$_SERVER['REQUEST_URI']));Eric Snyder
FWIW, the problem in that line is the array_pop, which wants to modify its argument (it removes the item as well as returning it), but can't because it's being given the return value of explode rather than a variable.IMSoP
"If I turn off the error reporting then the script does not execute." This sounds very unlikely (unless your script is actually failing already and you're just not seeing it in the sea of strict standards notices).IMSoP

2 Answers

2
votes

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.

1
votes

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']));