Jump to content

php.ini location


newb

Recommended Posts

http://www.php.net/manual/en/configuration.file.php

 

 

If it's loaded as an Apache module, you can set the PHPIniDir option.

 

Example (this would go in httpd.conf or a file included by httpd.conf):

 

PHPIniDir "/Path/To/PHP/Folder/"

 

 

 

Or you could set the PHPRC environmental variable.  (That should be explained on that linked page.)

Link to comment
https://forums.phpfreaks.com/topic/165245-phpini-location/#findComment-871434
Share on other sites

1. SAPI module specific location

* PHPIniDir directive in Apache 2

* -c command line option in CGI and CLI

* php_ini parameter in NSAPI

* PHP_INI_PATH environment variable in THTTPD

2. The PHPRC environment variable (Before PHP 5.2.0 this was checked after the registry key mentioned below.)

3. HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)

4. Current working directory (for CLI)

5. The web server’s directory (for SAPI modules)

6. Directory of PHP (If Windows)

7. Windows directory (C:\windows or C:\winnt)

8. –with-config-file-path compile time option

 

The path in which the php.ini file is looked for can be overridden using the -c argument in command line mode. (cgi) /home/user1/htdocs/cgi-bin/php.cgi -c /home/user1/php.ini

 

the PHPRC is a system environment variable

Link to comment
https://forums.phpfreaks.com/topic/165245-phpini-location/#findComment-871441
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.