Click to See Complete Forum and Search --> : php.ini


jinwu
03-27-2008, 09:23 PM
The phpinfo() told me that the configuration file (php.ini) path is C:\windows,
But actually the php.ini is in C:\PHP\ and there is no php.ini in my C:\windows, how php.ini() get configuration info?

Will you tell me, How may I load php.ini from the correct path?

halojoy
03-27-2008, 09:46 PM
The phpinfo() told me that the configuration file (php.ini) path is C:\windows,
But actually the php.ini is in C:\PHP\ and there is no php.ini in my C:\windows, how php.ini() get configuration info?

Will you tell me, How may I load php.ini from the correct path?
Your webserver, like Apache may use another value for finding php.ini
Apache needs to find php.exe and php.ini in order to execute PHP Pages.

Windows can have some environment or values path for php.ini
but is not always the same as used by Apache.

But I find it strange that phpinfo() gives wrong value for where current php.ini is located.
It usually is correct value for me.
When I change php.ini settings in that specific file, and re-start my server
then these changes will take effect.

For example, if I disable php_mysql.dll module,
then it will not show in phpinfo() list of modules
:D

laserlight
03-27-2008, 11:48 PM
The phpinfo() told me that the configuration file (php.ini) path is C:\windows,
But actually the php.ini is in C:\PHP\ and there is no php.ini in my C:\windows, how php.ini() get configuration info?

Will you tell me, How may I load php.ini from the correct path?
In depends on your webserver software, but assuming you use Apache, in the Apache configuration directory (httpd.conf), add the line:
PHPIniDir "C:/PHP"

Restart the webserver, then check phpinfo(). The "Configuration File (php.ini) Path" setting should be the same, but now "Loaded Configuration File" should point to "C:\PHP\php.ini".

Apache needs to find php.exe and php.ini in order to execute PHP Pages.
That is not quite true since php.exe is the command line interface executable and default settings are used if php.ini cannot be found.