Jump to content

PHPIniDir problems


Recommended Posts

Trying to learn php using apache, have been doing fine so far, except for my next task I need to edit php.ini. Had some trouble getting php to install because the book I'm using made no mention of PHPInidir. After discovering this I put it into the httpd.conf file under my load module as PHPIniDir C:/WINDOWS/. Didn't work. Changed it to PHPInidir C:/PHP (where my php files reside, except for the ini file which is in WINDOWS), and it works. Putting php.ini into the php folder breaks it. Leaving it in windows fixes it.

 

My problem is I'm now trying to edit the php.ini file and it doesn't seem to be affected, as if apache isn't actually reading that file. There is no .ini file in my php folder. Is there some information I'm missing here?

 

Again if I change phpinidir to the C:/WINDOWS where my ini file actually resides, it breaks, if I move php.ini to C:/PHP in accord to my currently configured phpinidir, it breaks.

Link to comment
Share on other sites

You need to be restarting Apache when making any changes to the php.ini

 

Also you should leave the php.ini (and any files that come with PHP) in C:/php and add PHP to the PATH Environment Variable.

 

You should enable a setting called display_startup_errors too within the php.ini. With this enabled PHP errors should pop up while Apache is starting up.

Link to comment
Share on other sites

Alright, did all that, got php working with all the files just in the php folder, but its still not reading my php.ini-development file. There is no other php.ini file.(Fixed this by changing php.ini back to php.ini-development which was its original name). I added ;C:\php to the end of the Path environment variable. Restarted comp completely, been restarting apache every time I make a change. phpinfo is still showing the inipath as C:\windows still, and changes I've made to smtp are not being reflected either. No errors on startup.

 

Is there someplace specific I'm supposed to put PHPIniDir "C:/php"? All I've been able to find is that you need it and not that you need it anywhere specific, I see no comments within the file for a section created just for this.

Link to comment
Share on other sites

PHPIniDir can placed any where in Apaches httpd.conf file.

 

When running phpinfo and checking to see if PHP is reading a php.ini file you should look at the line labeled as Loaded Configuration File. Ignore the line above labeled as Configuration File (php.ini) Path

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.