php.ini question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

php.ini question

Post by nawhaley »

I have a issue thats been annoying me to no end and perhaps someone here may have the answer. I just got done making some modifications to my php.ini file and ran phpinfo() to make sure apache was seeing the modifications that I had made. Now I know for a fact I am modifying the correct .ini since I looked at the phpinfo() file to find out which directory it was pulling the ini file from yet it does not reflect ANY changes to the ini when I run phpinfo(). does this command pull from the php.ini file for its information or not? Should I mostly ignore it for configuration purposes and simply use it for testing purposes?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

1. Have you restarted Apache?
2. Look in your phpinfo and see which php.ini it is using and make sure it was the one you are using
Last edited by John Cartwright on Wed Jul 27, 2005 2:58 pm, edited 1 time in total.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Under most situations you'll need to restart the web server for the changes to take effect. If you're running apache on *nix, "sudo apachectl restart"
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

yes I'm shutting down the apache server and bringing it back up and it still does not show the change. This has to be the most "frustrating" thing in the world. I know I'm making the changes, I know I'm saving the file because I'm double checking it and I know I'm shutting down the server because I'm even going into task manager to make sure a rogue instance of it isnt hung up somewhere and still nothing :(. I really need some help with this its set development back days because I cant get sessions to work due to the fact it will "not" accept modifications to the ini.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Are you sure apache is using the ini file you think it is?

phpinfo();

Configuration File (php.ini) Path /etc/php4/php.ini
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I repeat myself:

Are you sure you are editing the correct php.ini?
Look in your phpinfo to check which one it is reading

Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini

Edit| Dang Tim ya beat me
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

Jcart wrote:I repeat myself:

Are you sure you are editing the correct php.ini?
Look in your phpinfo to check which one it is reading

Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini

Edit| Dang Tim ya beat me
yes I am 100% certain I am modifying the proper php.ini file and yes I am 100% positive I am shutting down the apache server and bringing it back up. in my phpinfo() it says C:\Windows. I'm then going under C:\Windows and altering the php.ini file from there and no where else. Now is there any other reason it may not reflect the modifications made in the "right" file.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

What OS? I once had a very similar problem, on Debian Linux where some subtle differences between configurations caused things to report the wrong php.ini location on the phpinfo() page.
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

nielsene wrote:What OS? I once had a very similar problem, on Debian Linux where some subtle differences between configurations caused things to report the wrong php.ini location on the phpinfo() page.
Windows xp professional

I'm using apache 2.0.54

php version 5.0.4

hope this helps and thanks for the assistance :).
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I'm trying to remember what the situation was ...

A few "out there" ideas, (I doubt any of these are it, but just in casw)
1. do you have a .htaccess file with lots of php_value directives overriding the php_ini

2. Check the httpd.conf, I think there was a way to specify an alternate one there that can override some things.

3. Check the php.ini, see if the there are second definitions of the changed values after the ones you were changing, etc
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

You will have to pardon my ignorance but on the topic of htaccess files I havent configured a single one of these so whatever is in them by default is whats there. I did find an override for what directives can be placed in htaccess files but its currently set to none. Should I have made some changes to a .htaccess file when I configured my php and if so how do I view them to make the necessary changes?

Also as far as I can tell nothing is making any further modifications to the values I changed in the php.ini file. I specifically changed the assigned session ID from phpsessid to phpsessid1 for testing purposes and also removed the ; from save_session_path and assigned it a valid windows directory path.

P.S. Pardon me if I dont respond again till tommorrow morning its near the end of my work shift and I try not to think about this rather irritating problem at home :).
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I've add the following to my httpd.conf (apache2 only)

Code: Select all

PHPIniDir &quote;C:/Program Files/php-5.0.4-Win32/&quote;
But i believe the INSTALL.TXT says you can also use the PHP5RC environment variable or a php.ini that is in the system path.. Anyway, the above approach is the one i prefer ;)
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

so bascially your telling it to look for the php.ini fle in your main php directory instead of the windows directory with that line if I'm reading it right. How is that helping the overall fact that any modifications made to the ini itself are being ignored by phpinfo()? I still think there is an underlying piece to my installation thats missing thats making this crop up like this.
nawhaley
Forum Commoner
Posts: 85
Joined: Wed May 18, 2005 11:43 am

Post by nawhaley »

I'm going to shamelessly bump this because I "can't" be the only person who has run into an issue like this someone has to have run into a problem configuring this ini file like I have. I mean if you couldnt configure this in a simple manner the whole language would be totally useless and its to widely used for that.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

How is PHP5 being used in httpd.conf...

Are you just using it as an interp[reter by manually associting php.exe with .php files OR are you loading mod_php5.dll (or whatever it's called)?

I think you need to do the latter in order to use that directive ;)
Post Reply