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.

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

报告相同问题?

悬赏问题

  • ¥30 基于信创PC发布的QT应用如何跨用户启动后输入中文
  • ¥20 非root手机,如何精准控制手机流量消耗的大小,如20M
  • ¥15 远程安装一下vasp
  • ¥15 自己做的代码上传图片时,报错
  • ¥15 Lingo线性规划模型怎么搭建
  • ¥15 关于#python#的问题,请各位专家解答!区间型正向化
  • ¥15 unity从3D升级到urp管线,打包ab包后,材质全部变紫色
  • ¥50 comsol温度场仿真无法模拟微米级激光光斑
  • ¥15 上传图片时提交的存储类型
  • ¥15 VB.NET如何绘制倾斜的椭圆