Posts Tagged ‘php’

where does the php.ini file go?

The Problem

I needed to add more memory to php but by default php installed from source (configure && make && make install) does NOT install the php.ini file. So where is waldo?

The Fix

Here is a code snip that shows what configuration file IS loaded when php is executed:

[root@mybox php-5.2.10]# php -r "phpinfo();" | grep Configuration
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => (none)
Configuration

This shows that the php.ini path is in /usr/local/lib. So I grabbed the php.ini-recommended, copied that file to /usr/local/lib/php.ini and this file has the memory_limit set to 128MB which should be enough for now….

[root@mybox php-5.2.10]# php -r "phpinfo();" | grep Configuration
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Configuration

Done!