Xampp 1.7.4 and PHP 5.3.5 (Deprecated warnings)

≡放荡痞女 提交于 2019-12-01 10:11:44

问题


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


回答1:


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's pear upgrade Config?) should do the job.




回答2:


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

  1. D:\xampp\php\PEAR\Config.php on line 80
  2. D:\xampp\php\PEAR\Config.php on line 166
  3. D:\xampp\php\PEAR\Config\Container.php on line 111



回答3:


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.

pear update-channels
pear upgrade-all

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.



来源:https://stackoverflow.com/questions/5617605/xampp-1-7-4-and-php-5-3-5-deprecated-warnings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!