Where can I find php.ini?

The best way to find this is:

Create a PHP (.php) file and add the following code:

<?php phpinfo(); ?>

and open it in a browser. It will show the file which is actually being read!

Updates by the OP:

  1. The previously accepted answer is likely to be faster and more convenient for you, but it is not always correct. See comments on that answer.
  2. Please also note the more convenient alternative <?php echo php_ini_loaded_file(); ?> mentioned in this answer.

Leave a Comment