Where's my php.ini file?

Associate
Joined
6 Dec 2002
Posts
661
Location
Belfast
I'm an Apache/PHP/MySQL newbie so I apologise if my question is dumb. However, I'm really puzzled as to where my php.ini is! I've installed Apache 2.2.2 and PHP 5.1.4 and the PHP seems to be working as I can test this using the phpinfo.php page.

However, I can't seem to find any trace of the php.ini file so I was wondering where the configuration is coming from? The reason I came across this is because I'm trying to setup MySQL and I need to modify some settings within the php.ini file. Within the Apache http.conf file the location of the php.ini is set to "D:/php" but the php.ini is NOT here. Nor is it in C:\WINDOWS. I have searched my entire computer for this file.

Any help would be much appreciated. Thanks.
 
It will be using default configuration values without a php.ini.

Do you have a php.ini-recommended or php.ini-dist in the same directory that PHP is installed in?

Rename/copy php.ini-recommended over to php.ini and restart Apache. php.ini-dist contains the default configuration values and so it's better to go with the recommended ini as a starting point.

I believe the installer should have created a php.ini for you, unless you downloaded the zip instead, so I'm not sure what happened there. You may need to edit the php.ini for the correct paths on your system etc.
 
Ok, I still can't figure out what's going on. The phpinfo() is stating that the "Configuration File (php.ini) Path" is C:\WINDOWS bit there is no php.ini file in this location. When I copy and rename the php.ini-recommended file into C:\WINDOWS and restart Apache I try launching the phpinfo() page it's just a blank page! What's going on?

It's strange as well that in the http.conf file I have "PHPIniDir" set to "D:/php" so why does phpinfo() think to look in C:\WINDOWS???

I'm really confused.
 
create a new test file in your web folder (i.e. you can 'open' it in a browser)

wang this in it:

Code:
<?php

echo 'hihi!';

?>
View it in your browser..


What are the results?
 
Dj_Jestar said:
create a new test file in your web folder (i.e. you can 'open' it in a browser)

wang this in it:

Code:
<?php

echo 'hihi!';

?>
View it in your browser..


What are the results?
I tried this and I can see hihi! in the browser. So now I have php.ini in the C:\WINDOWS directory, and in the http.conf file I have "PHPIniDir" set to "C:/WINDOWS" but I still get a blank page with phpinfo(). Why am I getting a blank page?
 
Back
Top Bottom