Page 1 of 4
php.ini does not get reloaded when i restart apache. WHY???
Posted: Wed Nov 15, 2006 7:08 pm
by ivj
This is the first time ever I'm dealing with PHP (I'm a Java guy), and this has not been a pleasant experience (on top of php problems I have a fever, so stick with me...)
I'm running Fedora 5, Apache 2.2.0 (I think), PHP 5.1.6. All compiled, freshly installed. All seems to run fine. I even installed a SugarCRM thingy (a giant php prog) and it worked just fine.
The other day I was reading php.ini and I realized I don't have a a log file specified (error_log). So I put in "/var/log/php", do /etc/init.d/httpd restart. I check my logs folder - no php in there. I play some more with php.ini, and no matter what I do - the changes don't get reflected, php is still working, and I don't get any errors in apache logs (or /var/log/messages).
I even tried setting engine = Off in php.ini - PHP still works.
I check my phpinfo() - I AM editing the correct file.
So, feeling desparate, I delete that file just to see what happens. I restart apache - WTF, php still works, everything works, no errors. ARGGHHHHH.
I remember reading somewhere that if your php.ini is faulty, PHP will use some other default php.ini which's stored in some secret folder or something like that. So I move php-recommended.ini into php.ini. Restart the server - same old crap, everything works, no errors, php.ini changes aren't reflected.
I'm getting pretty desparate not being able to figure this out. Any help is greatly appreciated.
Posted: Wed Nov 15, 2006 7:45 pm
by volka
According to
http://distrowatch.com/table.php?distribution=fedora fc5 ships with php 5.1.2.
So exactly how did you install apache and php?
Posted: Wed Nov 15, 2006 7:46 pm
by RobertGonzalez
Have you searched your system for php.ini files? There is a chance that you are editing one (that you think is correct) and that PHP is using a different one.
PS On my FC5 the ini file is in /etc/php.ini.
Posted: Wed Nov 15, 2006 8:26 pm
by John Cartwright
Moved to Apache, IIS, and Web Servers.
Pay Attention Everah.

Posted: Wed Nov 15, 2006 9:02 pm
by neophyte
Yeah run phpinfo(). At the top somewhere will be the path to your ini. Check it to make sure you are editing the proper file. If you are editing the proper file do you have any .htaccess commands that may be interfering?
Posted: Wed Nov 15, 2006 9:33 pm
by nickvd
This might of been said before (or i may be wrong), but did you turn on LogErrors in your php.ini file (obviously run phpinfo to ensure you're editting the right file)
Posted: Wed Nov 15, 2006 10:30 pm
by ivj
Please, please, PLEASE
read my post before posting.
I check my phpinfo() - I AM editing the correct file.
I searched my system and it is the only php.ini file (except for php.ini-dist and php.ini-recommended which are located in the source folder).
My fedora 5 (I didn't install it myself) didn't come with php, it only came with apache.
Posted: Wed Nov 15, 2006 11:00 pm
by nickvd
Did you turn "log_errors" on?
Posted: Thu Nov 16, 2006 10:36 am
by RobertGonzalez
ivj wrote:I searched my system and it is the only php.ini file (except for php.ini-dist and php.ini-recommended which are located in the source folder).
My fedora 5 (I didn't install it myself) didn't come with php, it only came with apache.
Is this a personal computer or a server? If it is a personal computer you can install PHP from the GUI interface so that it works as an Apache Module on your system. If you compiled PHP then you are going to have more than one php.ini file on your system (one in the location where PHP was built and one in the location that
make install creates).
Posted: Thu Nov 16, 2006 8:09 pm
by ivj
nickvd: It doesn't matter if I turn it on or off - my logfile doesn't get reloaded. If I turn it on in the code - there are no errors regarding the php.ini or anything.
Everah: It's a server, no GUIs here. I did compile PHP but there are no php.inis (except for the -recommended and -dist ones (like I've mentioned earlier)), and phpinfo() points to the file I'm editing.
If I delete that file, I can still run apache and PHP will work. What conf file does it use? phpinfo() gives me a path that doesn't exist, so wtf?
Posted: Thu Nov 16, 2006 8:15 pm
by feyd
php.ini isn't required to run PHP. If not found, PHP will use the defaults for everything, including where its reading php.ini from. Misleading, but that's how it works.
Posted: Thu Nov 16, 2006 8:27 pm
by ivj
Ok... but if I have a file in there and it's syntax is bad.. does it use all the defaults too? Shouldn't it write out the errors somewhere or something?
Posted: Fri Nov 17, 2006 10:31 am
by RobertGonzalez
feyd wrote:php.ini isn't required to run PHP. If not found, PHP will use the defaults for everything, including where its reading php.ini from. Misleading, but that's how it works.
You learn something new everyday. Thanks feyd.
Posted: Fri Nov 17, 2006 12:50 pm
by feyd
ivj wrote:Ok... but if I have a file in there and it's syntax is bad.. does it use all the defaults too? Shouldn't it write out the errors somewhere or something?
Many startup errors will fail the loading of PHP. When used as a module, this means the web server will likely fail to load too. Every time I've had something error the startup, it was always output to the console (or desktop.)
Posted: Mon Nov 20, 2006 2:44 pm
by ivj
Um both apache and php work, even though I obviously put errors into php.ini or remove it. So what the hell?
You're PHP pros here, tell me something, how can I "turn off" php without httpd.conf by messing up php.ini?