kinda Posted February 15, 2008 Share Posted February 15, 2008 I am having a very frustrating problem that hasn't been solved from searching other thread here. It seems I have an invisible php.ini file somewhere! I'm running php 5.2.5 on apache 2.0.59 and mysql 5.0 php works from command line, apache works and basic php scripts all work. The problem is when I try to add extensions such as GD and mysql in the php.ini. From phpinfo(), Configuration File (php.ini) Path is c:\window and Loaded Configuration File is (none). This is despite the apache httpd having PHPIniDir "C:/Program Files/php/" and the path set to the same in the system environmental variables. It looks to me like it was an issue of where php.ini was. I can't seem to change the config file path in phpinfo() regardless of what I try. So I put my php.ini in c:\windows\ but no change when I run phpinfo(). I even removed every php.ini file from my system and still the phpinfo() remains unchanged (and php scripts still worked fine). I restart apache after every change and restart the computer after every system environmental variable change. Where is the php.ini file that I need to alter to allow extensions? Should my scripts still work without any php.ini files, is there some default behaviour? Please help me change the Configuration File (php.ini) Path or find what it is reading from while I still have some hair left! Quote Link to comment https://forums.phpfreaks.com/topic/91340-installation-problems-phpini/ Share on other sites More sharing options...
wildteen88 Posted February 16, 2008 Share Posted February 16, 2008 okay try this. comment out any extensions your have enabled within the php.ini - add a # at the start of the line to comment lines out. Also enable a setting called display_startup_errors. Save the php.ini and restart Apache. Has PHP managed to find your php.ini? Note: Ignore the Configuration File (php.ini) Path line. Only the Loaded Configuration File line needs to be set correctly. Also how have you configured Apache with PHP? Apache Module or CGI? And where is the PHPIniDir directive located within the httpd.conf Quote Link to comment https://forums.phpfreaks.com/topic/91340-installation-problems-phpini/#findComment-468273 Share on other sites More sharing options...
sanjivus Posted February 21, 2008 Share Posted February 21, 2008 I am going through the same pain. I have the following environment: Windows 2003 Enterprise Server + SP2 Apache 2.0.63 PHP 5.2.5 My SQL 5.0 I have installed Apache, PHP and MySQL using the windows installer. Following are the lines are at bottom of my httpd.conf ########## PHP SETTINGS START ############## PHPIniDir "C:\WAMP\PHP\" LoadModule php5_module "C:/WAMP/PHP/php5apache2.dll" AddType application/x-httpd-php .php ########## PHP SETTINGS END ############## I have commented all the extensions in PHP.ini. I have turned on display startup errors. I restart Apache everytime I make any change in httpd.conf or php.ini. I have restarted server several times. I am able to read the PHP.ini using the following code. Just wanted to rule out any permission problems. <?php $filename = "C:\WAMP\PHP\php.ini"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); fclose ($handle); echo "$contents"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/91340-installation-problems-phpini/#findComment-473078 Share on other sites More sharing options...
wildteen88 Posted February 22, 2008 Share Posted February 22, 2008 @sanjivus remove the trailing slash on the following line: PHPIniDir "C:\WAMP\PHP\" So the above line looks like: PHPIniDir "C:\WAMP\PHP" Save your httpd.conf and restart Apache. I find it best to leave of trailing slashes for directory paths. Quote Link to comment https://forums.phpfreaks.com/topic/91340-installation-problems-phpini/#findComment-473853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.