简体   繁体   English

PHP奇怪的错误信息

[英]PHP strange error messages

I have created a website 3 month ago. 我在3个月前创建了一个网站。 I uploaded it to internet and it worked(it still works there). 我将其上传到了互联网,并且可以正常运行(仍然可以正常运行)。 Now I installed it in my local computer and trying to access it. 现在,我将其安装在本地计算机上并尝试访问它。 However it prints the following error messages multiple times: 但是,它多次打印以下错误消息:

Deprecated: Assigning the return value of new by reference is deprecated in C:\\xampp\\htdocs\\ptr\\xajax\\xajax_core\\xajax.inc.php on line 1258 不建议使用:在第1258行的C:\\ xampp \\ htdocs \\ ptr \\ xajax \\ xajax_core \\ xajax.inc.php中,弃用了通过引用分配new的返回值

Strict Standards: Only variables should be assigned by reference in C:\\xampp\\htdocs\\ptr\\xajax\\xajax_core\\xajaxPluginManager.inc.php on line 269 严格标准:第269行的C:\\ xampp \\ htdocs \\ ptr \\ xajax \\ xajax_core \\ xajaxPluginManager.inc.php中的引用只能分配变量

I am using XAJAX framework and the errors have something to do with this framework. 我正在使用XAJAX框架,并且错误与该框架有关。 Since I haven't changed anything in the library files, I don't understand what the problem can be. 由于我没有更改库文件中的任何内容,因此我不明白问题可能出在哪里。 Please help... I am freaking out 请帮忙...我吓坏了

Unfortunately this kind of statement are deprecated from PHP 5 . 不幸的是, PHP 5不赞成使用这种语句。 In your local machine you're running a version which is 5.3 while your server is running an older version. 在您的本地计算机上,您正在运行的版本是5.3,而服务器正在运行旧的版本。 Thus, on your machine is thrown a E_STRICT error. 因此,在您的计算机上引发了E_STRICT错误。 To avoid this problem, you have to change lines like: 为避免此问题,您必须更改以下行:

$node_obj =& new someClass($somearg, $moreargs);

into

$node_obj = new someClass($somearg, $moreargs);

The framework you are using seems to be a little bit outdated and uses such constructs 您正在使用的框架似乎有些过时,并且使用了这样的结构

$x = & new Classname();

The & before new is deprecated since PHP 5.0 (which is several years old now). 自PHP 5.0(已存在数年)以来,不推荐使用new之前的& With the introduction of E_DEPRECATED - and E_STRICT -messages it throws such a message now. 随着E_DEPRECATEDE_STRICT消息的引入,它现在抛出这样的消息。

Xajax 0.6 targets this and a couple of other issues. Xajax 0.6针对此问题以及其他一些问题。 When the development on xajax 0.5 started many users were still trapped on PHP4 Webservers and this syntax helped maintain compatibility for PHP4 up to 5.2.x. 当xajax 0.5的开发开始时,许多用户仍然被PHP4 Web服务器所困,这种语法有助于保持PHP4到5.2.x的兼容性。 Xajax 0.6 can be found on https://github.com/Xajax/Xajax-Project Though it's still beta, it's already pretty solid. 可以在https://github.com/Xajax/Xajax-Project上找到Xajax 0.6,尽管它仍然是beta版,但已经非常可靠。 Many deprecated function were dropped and the core was shrinked & optimized. 弃用了许多不赞成使用的功能,并缩小并优化了内核。

Previous comments fully explain the source of those warnings. 先前的评论完全解释了这些警告的来源。 Your website will work fine despite of them. 尽管有它们,您的网站仍能正常工作。 But you can disable PHP error reporting, if you want to hide these messages - this manual may help you: http://complete-concrete-concise.com/web-tools/how-to-turn-off-display_errors-in-xampp (UPD: For your local version only of course) 但是,如果您想隐藏这些消息,则可以禁用PHP错误报告-本手册可以为您提供帮助: http : //complete-concrete-concise.com/web-tools/how-to-turn-off-display_errors-in- xampp (UPD:当然仅适用于本地版本)

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

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