How to Find Your php.ini file location

By | May 10, 2008

Often you need to make changes to your php.ini file. If you run locate php.ini, you will find some files, but this search won’t guide you to the correct one. You need one php.ini file that is used by current server configuration. Only changes that are applied there will be propagated to your php configuration. But how to detect which one of these PHP configuration files are those you need? There are two simple solutions and one of them won’t even require using SSH. Create a php file with the following contents:


and run it from your browser. The output should be like this:

Just check what I’ve selected and you will find the path to your php.ini file.

The second solution is even easier but it requires SSH access. Just log in via SSH and type the following command: php -i | grep php.ini . Take a look at my output below:

This is the exact solution on how to find where your configuration file is located. Its location may be changed when installing Zend Optimizer or other stuff like this. Hope this article will help you to find where it is.

One thought on “How to Find Your php.ini file location

  1. Pingback: How to Enable Ioncube Support For The Entire Server | LAMPdocs: Linux, Apache, MySQL, PHP

Comments are closed.