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 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条