Jump to content

Installation problems - php.ini


Recommended Posts

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!

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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"; 
?> 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.