duan4369 2013-05-24 19:03
浏览 71
已采纳

在我将我的wamp PHP版本降级到5.2.11之后,我怎样才能启动Apache?

I'm trying to run a PHP application full of depracted ereg calls. I got the wampserver extension to switch from PHP 5.3.10 to 5.2.11, where that function is still valid, but when I try to start my services Apache won't start. I'm using Apache 2.2.11, PHP 5.2.11, and MySQL 5.5.20 on Windows 7 x64. The index.php page I'm trying to load comes up when I use PHP 5.3.10, albeit with a lot of errors about my ereg functions.

I get that I can go through all my PHP files and update the code to modern usage, but shouldn't I be able to use wampserver's PHP version extensions, since they're offered?

I've tried copying .dll's from /wamp/bin/php/php5.2.11/ directly into /wamp/bin/ but it looks like the installer for the 5.2.11 extension had taken care of that already. It also seems to have updated php.ini during install.

The Apache error log shows zero activity when I try to start wamp services. Not even notices.

I'm pretty new to Apache and PHP so I'm not sure what relevant info I could paste from php.ini or httpd.conf but if there's anything in either of those that you think would be helpful to work toward a solution, let me know and I'll paste it.

  • 写回答

1条回答 默认 最新

  • doupu0619 2013-05-26 14:33
    关注

    The ereg function was "depreciated" as of PHP 5.3... Depreciated does not mean it was removed, all it means is that every time it's used, a "notice" (not error) message will be logged (and in some cases displayed on screen). That is, it's still valid in PHP 5.3. And I don't believe it was removed in PHP 5.4 if memory is correct. I think it will only be removed in PHP 6.

    All you have to do is configure your php.ini settings to not log or display the E_DEPRECATED notice.

    Here are the php.ini lines from my WampDeveloper Pro set up, just find the same directives in WampServer and adjust...

    error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
    display_errors = On
    

    The first line will use all levels, and then remove the notices, depreciated, and strict-coding levels.

    That last line you might or might-not want to be On or Off depending on if this is a dev system or a production system (security reasons).

    You can also just leave it all as-is, and not log repeat messages ... that way you still know what's going via the logs, but they are not filled up with the same message over and over:

    ignore_repeated_errors = On

    But whatever you do, don't use PHP 5.2, it's full of bugs, performance, compatibility, and security problems.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100