简体   繁体   中英

How to set php.ini location?

I just installed PHP, Apache and MySQL, did some changes to the configuration files and it works but phpinfo() says it looks for php.ini in C:\\Windows. How to make it look somewhere else? Should I configure this in Apache? I put:

SetEnv PHPRC "C:/wamp/php5.6.5"

in http.conf, restared Apache but it didn't help. I know that programs like WampServer use phpForApache.ini instead of php.ini but I don't know how they do this.

Taken word for word from the docs...

As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined in order: [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\xyz], [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\xy] and [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for IniFilePath in any of these keys, the first one found will be used as the location of the php.ini (Windows only).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM