简体   繁体   English

Apache重新启动后,PHP 4不会更改PHP.ini

[英]PHP 4 won't take PHP.ini changes after Apache restart

We have a very old PHP application that needs PHP 4 to run. 我们有一个非常老的PHP应用程序,需要PHP 4才能运行。 We're decommissioning the old server and so I've built PHP 4 on the new server (Ubuntu 13.04 32 bit). 我们即将淘汰旧服务器,因此我已经在新服务器(Ubuntu 13.04 32位)上构建了PHP 4。 When I did ./configure I made sure to do --with-config-file-path=/etc/php4/php.ini . 当我执行./configure ,请确保执行--with-config-file-path=/etc/php4/php.ini I'm trying to enable error logging, but my changes to the php.ini don't seem to be taking hold. 我正在尝试启用错误日志记录,但是对php.ini更改似乎没有生效。

Yes, the file exists and is owned by the Apache user 是的,该文件存在并且由Apache用户拥有

nick@server:/etc/php4$ ls
php.ini

Yes, I restarted Apache. 是的,我重新启动了Apache。 And yes, it shows up in the phpinfo() : 是的,它显示在phpinfo()

Configuration File (php.ini) Path   /etc/php4/php.ini

Does the --with-config-file-path only take hold at compilation time and thus in order to make changes I have to recompile? --with-config-file-path仅在编译时生效,因此为了进行更改,我必须重新编译? Or does it work the same as newer versions of PHP? 还是与更新版本的PHP一样工作?

For example, in the php.ini I've turned off display_errors , but phpinfo() shows: 例如,在php.ini我关闭了display_errors ,但是phpinfo()显示:

display_errors  On

Note that it shows On for both the local and master values for this server. 请注意,对于此服务器的本地值和主值,它都显示为“ On ”。

Also, I'm sorry for perpetuating PHP 4 另外,很抱歉让PHP 4永久存在

My php.ini and screenshot of phpinfo to prove I'm not lying 我的php.ini和phpinfo的屏幕截图证明我没有说谎

--with-config-file-path expects a directory, not a filename. --with-config-file-path需要目录,而不是文件名。 So with your confiuration PHP would look for /etc/php4/php.ini/php.ini . 因此,随着您的配置,PHP将寻找/etc/php4/php.ini/php.ini

Background: The reason for taking a path is that in fact PHP is looking for different files in order: First a SAPI specific file php-$SAPI.ini and then the generic php.ini . 背景:采取路径的原因是,事实上PHP正在按顺序查找不同的文件:首先是特定于SAPI的文件php-$SAPI.ini ,然后是通用的php.ini This allows ie using a different configuration on CLI where initial startup time matters more and other caching settings (apc etc.) are required. 这允许在CLI上使用其他配置,在该配置中,初始启动时间更为重要,并且需要其他缓存设置(apc等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM