TIP: Where to find global php.ini file in Debian
So let’s say you get the following error message on your Debian system while browsing a LAMP application like MediaWiki:
Allowed memory size of 147281674 bytes exhausted in <some-file>.php on line 57
Then you start to search on the Internet with the above error message and you find advices like:
memory_limit = 32M to your server’s main php.ini file (recommended, if you have access)
memory_limit = 32M to a php.ini file in your application’s php file
ini_set(‘memory_limit’, ’32M’); in your sites/default/settings.php file
php_value memory_limit 32M in your .htaccess file
Problem
Let’s say you decide to go with the first suggestion i.e. to increase the PHP memory limit globally all across your applications running on your Debian System. Soon you realized that you are not able to find that master php.ini file on your Debian system.
Solution
The easiest way to find is to access the phpinfo() function on your system by launching a web-browser and typing the name (or IP address) of your Debian server like this:
http://myservername/phpinfo
and look for the following entry:
Loaded Configuration File etc/php5/apache2/php.ini
that is basically where your global php.ini file resides on your system.
Any application that uses Apache will read the value of the parameter:
memory_limit = 128M
set in your /etc/php5/apache2/php.ini file.
That’s it!



Email Subscription









February 7th, 2013 at 10:11 am
The only problem with this is that, phpinfo is disabled on my server and I’m trying to find the location of php.ini to enable it. So this approach doesnt work for me! :)
Reply to this comment