Women in Technology

Hear us Roar

  PHP 4.3 and Mac OS X
Subject:   where is php.ini
Date:   2003-01-17 00:45:01
From:   anonymous2
Anyone know where php.ini is installed after completing this process? I couldn't find it in /etc or /usr/lib/php.
Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • where is php.ini
    2003-02-28 18:40:14  tychay [View]

    The default compile of php no longer installs a php.ini file.

    There are two included with the php distribution php.ini.dist and php.ini.recommended(?).

    The place to put the config file is in /etc/php.ini (if using Apple's directives) or /usr/local/etc/php.ini (if using the default configure, or Mark's compile). The quick way to find out (assuming php4.3+) is

    bash-2.05a$ php -r "phpinfo();" | grep Configuration
    Configuration File (php.ini) Path => /etc

    If you can't do that (because you are using pre 4.3, for shame!) then try the <?php phpinfo() ?> script another post mentioned.

    Hope this helps,

    terry chay
    tychay at php dot net
    • where is php.ini
      2005-06-10 07:46:19  zicco [View]

      if php -r does not work for your vertion of php, you can do (Linux only):

      echo "<?php phpinfo(); ?>"|php |grep Configuration
  • where is php.ini
    2003-01-17 02:27:18  maarky [View]

    I've always upgraded PHP using Mark Liyange's binaries (http://www.entropy.ch/software/macosx/php - he has been away since around mid December and hasn't updated his binaries, but he says he will be back around mid January and that he will update them then. Now that this article is out I may go ahead and update it myself.) In his FAQ he says that no php.ini file is included so if you want one you should create it here:


    So that's what I did and it worked fine. I don't know if this is the proper location if you follow the instructions in this article.

    Another idea is to create a PHP file containing only:

    <?php phpinfo() ?>

    View this file in your browser. At the top in the first table you will see a cell labled "Configuration File (php.ini) Path". Check the path it gives in the next column over. If your php.ini file is not there then try creating one in that location.
    • where is php.ini
      2003-09-26 11:36:44  anonymous2 [View]

      I'm under Os X (not server) and using the "default" 4.1.2 php installed. My "info.php" says that php.ini must be at
      but is not there!
      Can php work without a php.ini ?? : Yes it works!
      If I create one (or copy there the 4.3.0 php.ini) what will happen? I'll post here of this experience.
      I need to work with php.ini cause I need the "allow_url_open" directive to allow my calls for readdir to open remote directories.