Shaked Klein Orbach echo 'Just smile';

18Dec/110

How to find your php.ini file

Finding your php.ini is pretty straight forward task: 

  1. open terminal or cmd 
  2. execute php --ini if php is undefined you should add it to your PATH or just execute "/your/path/to/php --ini"
  3. php.ini has several modes (path is different sometimes...):
    1. using one file: 

      Configuration File (php.ini) Path: /etc/php5/cli
      Loaded Configuration File: /etc/php5/cli/php.ini

    2. using several different files (will help to maintain common settings between cli php.ini and httpd php.ini

      Scan for additional .ini files in: /etc/php5/conf.d
      Additional .ini files parsed: /etc/php5/conf.d/ctype.ini,
      /etc/php5/conf.d/curl.ini, 
      /etc/php5/conf.d/dom.ini,
      /etc/php5/conf.d/gd.ini,
      /etc/php5/conf.d/hash.ini,
      ............more .ini files here............  

      files content could be "extension=gd.so" (unix) or "extension=gd.dll" (windows)

  4. there are two more options to get your ini files: 
    1. execute in cli mode: "php --i | grep .ini"
    2. write your own script and check via browser:
      <?php phpinfo(); ?>  

That's it, now you can just edit your php.ini with anything you think you will need for future PHP programming. 
More about php.ini may be found at http://php.net/manual/en/ini.php 

Posted by Shaked

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.