Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check where Apache is looking for a php.ini file?

Tags:

php

apache

I have a feeling that Apache is using a different php.ini file that the one I am editing. I make a change in my php.ini file, restart Apache, and the change doesn't take affect. So I don't know what to do anymore.

Any ideas?

Update: Found out it's using the right php.ini file...but I still don't know what to do!

like image 775
Andrew Avatar asked Nov 12 '09 18:11

Andrew


2 Answers

To find the file that's being run by PHP, create a phpinfo file (just <?php phpinfo();?>) and look for the 'Configuration File (php.ini) Path' directive.

like image 52
Sean Avatar answered Oct 14 '22 02:10

Sean


from the command line, run

php -i |grep "php.ini"  

This will describe the location php is loading its ini file from. You can reconfigure the php.ini location by recompiling php.

like image 38
Zak Avatar answered Oct 14 '22 02:10

Zak