PHP 4 will not accept PHP.ini changes after restarting Apache

We have a very old PHP application that requires PHP 4. We are decommissioning the old server, so I created PHP 4 on the new server (Ubuntu 13.04 32 bit). When I did ./configure , I definitely did --with-config-file-path=/etc/php4/php.ini . I am trying to enable error logging, but my changes in php.ini do not seem to be held back.

Yes, the file exists and belongs to the Apache user.

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

Yes, I restarted Apache. And yes, this is displayed in phpinfo() :

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

Is --with-config-file-path at compile time, and so I have to recompile to make the change? Or does it work just like newer versions of PHP?

For example, display_errors disabled in php.ini , but phpinfo() shows:

 display_errors On 

Note that it shows On for both the local and the main value for this server.

Also, I'm sorry about keeping PHP 4

My php.ini and a phpinfo screenshot to prove that I am not lying

+8
php php4
source share
1 answer

--with-config-file-path expects a directory, not a file name. Thus, with your Confiuration, PHP will look for /etc/php4/php.ini/php.ini .

Background: The reason for the transition is that PHP is actually looking for different files in order: first the file for the specific SAPI php-$SAPI.ini , and then the general php.ini . This allows, for example, to use a different configuration in the CLI, where the initial start-up time is more important, and other caching settings are required (apc, etc.).

+2
source share

All Articles