Xampp 1.7.4 和 PHP 5.3.5(已弃用的警告)
我刚刚将我的 Xampp 安装升级到 1.7.4
我有一个工作脚本(jquery 调用 PHP 脚本并显示返回值)。
升级后,我的 jquery 正确获取了结果,但除了结果之外,还返回了一些警告,因此停止我的脚本以显示结果(我签入了 firebug)。以下是警告:
已弃用:在 D:\xampp\php\PEAR\Config.php 的第 80 行中,已弃用通过引用分配 new 的返回值< br>
已弃用:在 D:\xampp\php\PEAR\Config.php 的第 166 行中,已弃用通过引用分配 new 的返回值< br>
已弃用:在 D:\xampp\php\PEAR\Config\Container.php 的 111
已弃用:在 D:\xampp\htdocs\phil\batteries\includes\class.db.php 行 中,已弃用通过引用分配 new 的返回值73
[“摩托车”、“踏板车”、“个人船只”、“雪地车”、“全地形车”、“驾驶式割草机”、“多功能车”]
请记住最后一行是返回的结果。但由于警告,结果未填充。可能是什么问题?我不想只是关闭错误报告。
谢谢
I just upgraded my Xampp installation to 1.7.4
I had a working script (jquery calling PHP script and showing the returned value).
After upgrade, my jquery is getting the result correctly, but in addition to the results, there are also some warnings that are returned, hence stopping my script to show the result (I checked in firebug). Here are the warnings:
Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Config.php on line 80
Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Config.php on line 166
Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Config\Container.php on line 111
Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\htdocs\phil\batteries\includes\class.db.php on line 73
["Motor Cycle ","Scooter","Personal Watercraft ","Snowmobile","ATV","Ride-on Mower","Utility Vehicle"]
Keeping in mind the last line is the result being returned. but due to warnings, results are not populated. What can be the problem? I dont want to just off the error_reporting.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
bug 已于 2008 年向 PEAR 配置人员提交< /强>。直到去年 12 月发布版本 1.10.12 时,他们才采取行动。
如果您可以更新该软件包,则应该更新。
pear update Config
(或者可能是pear update Config
?)应该可以完成这项工作。A bug was filed with the PEAR Config folks in 2008. They didn't act on it until last December, when version 1.10.12 was released.
If you can update that package, you should.
pear update Config
(or maybe it'spear upgrade Config
?) should do the job.好吧,事情就是这样。正如警告中提到的,问题出在 PEAR 文件中。
我刚刚更改了问题中提到的文件。并删除
到
我的脚本又启动了。 PEAR 文件有三个警告,即
Ok here was the deal. The problem was in the PEAR files as mentioned in the warnings.
I just changed the files mentioned in the question. and removed
to
and my script is up again. There were three warnings for PEAR files i.e
PHP 5.3 将一些较旧的函数标记为已弃用,因此您的 php 脚本现在会抱怨它们是否正在使用其中之一。
解决这个问题的一个肮脏的方法是改变 php 错误行为(通过 php.ini 或在使用 error_reporting)
更好:如果有可能更新,请更新您的 PEAR 脚本。
首先在安全的环境中尝试此操作,以避免由于您正在使用的 pear 脚本可能发生更改而破坏更多代码。
可以在此处找到现已弃用的所有已更改函数的详细摘要。
PHP 5.3 marked a few older functions as deprecated, therefore your php scripts now complain if they're using one of those.
A dirty way to get round this would be changing the php error behaviour (either via php.ini or in the script itself while using error_reporting)
Better: Update your PEAR-scripts, if there are updates possible.
Try this in a safe enviroment first to avoid breaking even more code due to possible changes in the pear scripts you're using.
A good summary of all the changed functions which are now deprecated can be found here.