简体   繁体   English

PHP - 严格标准错误5.4。?

[英]PHP - Strict Standards error with 5.4.?

I (like a lot of others) am seeing Strict Standards errors with PHP 5.4.???. 我(和很多其他人一样)看到PHP 5.4的严格标准错误。

Strict Standards: Only variables should be passed by reference in /home/xxxxxx/public_html/xxxxxx/init.php on line 64 严格标准:只应在第64行的/home/xxxxxx/public_html/xxxxxx/init.php中通过引用传递变量

There must have been a change between 5.3 and 5.4. 5.3和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. 在这种情况下,这是一个程序(由其他人写的1,000行),我不愿意尝试解决。

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"? 是否有可以放在.htaccess文件中的设置,允许“非严格标准”?

You need to go into your php.ini file and assign the following: 你需要进入你的php.ini文件并分配以下内容:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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