Home > Article > Backend Development > Notes on setting up PHP and Apache environment_PHP tutorial
What is the role of PHPIniDir when setting up Apache?
What is the role of PHPIniDir when setting up Apache?
Unlike php4 which searches for php.ini under %SystemRoot%, PHP5 searches for PHP.ini in the following order:
* PHPIniDir (Apache 2 module only)
* Registry key value: HKEY_LOCAL_MACHINE—SOFTWARE—PHPIniFilePath
* Environment variable:%PHPRC%
* PHP5 directory (for CLI), or web server directory (for SAPI modules)
* Windows directory (C:windows or C:winnt)
So if it is Apache + PHP5, you can use PHPIniDir to specify the path of the php5 configuration file php.ini.
As in httpd.conf:
#Run php as apache module
LoadModule php4_module /apache/php/sapi/php4apache.dll
PHPINIDir /apache/php/php.ini
To rewrite your PHP installation path here