Search code examples
phpapacheosx-elcapitanphp-ini

PHP.ini location on El Capitan


Simple question: where is the correct PHP.INI location in Mac OSX El Capitan?

I tried to update the one in /etc folder, but nothing changed.


Solution

  • Simple solution

    1. create php info file in your web folder

      <?php
      
       // Show all information, defaults to INFO_ALL
      phpinfo();
      
      ?>
      
    2. open the file in browser

    3. look for

    INFO_GENERAL 1 The configuration line, php.ini location, build date, Web Server, System and more.

    Taken from php manual


    Another option is to use

    <? php_ini_loaded_file(); ?>