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
https://forums.phpfreaks.com/topic/164564-phpinidir-problems/
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
https://forums.phpfreaks.com/topic/164564-phpinidir-problems/#findComment-868490
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
https://forums.phpfreaks.com/topic/164564-phpinidir-problems/#findComment-871465
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
https://forums.phpfreaks.com/topic/164564-phpinidir-problems/#findComment-872109
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.