Error Log Not Working
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Apache Error Log Not Working
of this site About Us Learn more about Stack Overflow the company php write to apache error log Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Php Error Log File
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a error_log doesn't work minute: Sign up Php error log not working up vote 6 down vote favorite 2 It's been working for ages and stopped. I must be missing something obvious so figured stack overflow might be able to help. /etc/php5/apache2/php.ini relevant settings are: display_errors = On (not sure if this makes a difference) log_errors = On error_log = "/var/www/error_log.log" In my code I have: php does not log errors echo 'About to log'; error_log('An error'); I see About to log on the page, but nothing in the error log. Any ideas? php apache error-log share|improve this question asked Feb 22 '11 at 0:54 Parris Varney 6,52663156 Check out error_reporting(); it may help or it may not. –tjmoore1993 Feb 22 '11 at 1:00 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote accepted Did you restart the Web server? Until you do php.ini changes are not considered. Also, if you want to track PHP errors, you need to have track_errors=On and error_reporting=E_ALL, although that is not related with error_log calls. Also make sure that the error log file is writeable by the Web server user. share|improve this answer answered Feb 22 '11 at 1:03 mlemos 591718 3 The file wasn't writable, I forgot I deleted and recreated it. Thanks. –Parris Varney Feb 22 '11 at 1:17 add a comment| up vote 7 down vote It ended up being permission issues. The file grew too big to open quickly, so I deleted and recreated it, but wit
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
No Php Error Log
this site About Us Learn more about Stack Overflow the company Business php send to error log Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
Php Error Log Permissions
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign http://stackoverflow.com/questions/5072987/php-error-log-not-working up PHP error_log method doesn't write errors to my error log file up vote 8 down vote favorite The PHP error_log method does not write errors to the custom error log file. It will only write to /var/log/apache2/php_error.log Here are the logging settings in my php.ini: error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE display_errors = Off log_errors = On log_errors_max_len = 0 ; http://stackoverflow.com/questions/7500532/php-error-log-method-doesnt-write-errors-to-my-error-log-file also tried with 9999999 error_log = /var/log/apache2/php_errors.log PHP writes its errors to the regular Apache error log (/var/log/apache2/error.log) rather than the one I specified above. Things I already tried: I stopped and restarted apache after changing the php.ini file The file /var/log/apache2/php_errors.log is 777 permissions and the file exists. There are no other overriding php.ini files. (There is /etc/php5/cli/php.ini but I'm not using cli). There are no other error_log = xxx settings further down the php.ini file which could overrule the first one phpinfo() says error_log = /var/log/apache2/php_errors.log (i.e. the correct file), both under Local Value and Master Value The test script I'm using to generate errors doesn't contain any ini_set calls (FYI: I'm using Apache/2.2.17 and PHP/5.3.5-1ubuntu7.2 on Ubuntu 11.04) What am I doing wrong? apache logging php share|improve this question edited Dec 13 '13 at 19:28 Eric Leschinski 46.6k23221190 asked Sep 21 '11 at 13:26 William Clark 95236 1 have you tried to change filename to some else? Or try some other folder? –Olli Sep 21 '11 at 13:30 1 Check what php.ini file is loaded (look at the output of php
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/20485105/errors-not-written-to-apache-error-log the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow http://superuser.com/questions/520522/how-to-log-php-error-in-a-separate-file Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each error log other. Join them; it only takes a minute: Sign up Errors not written to Apache error log up vote 0 down vote favorite 1 I've had a problem with some Apache web server error logs. I have a virtually hosted website scotthermmann.loc on my computer. After I manually clear an error log, using sudo cat /dev/null > scotthermmann.loc-error_log php error log or by opening the file in emacs & deleting all content, errors no longer get logged to the file. I've tried using sudo apachectl restart to solve the problem, but it doesn't solve it. Logging out & back in doesn't solve it either. What does solve it is restarting the computer, but I don't want to do that after every time I clear an error log. This isn't the case for every website I host. I have another website barefootfool.loc. After I clear that error log, I don't have any problems. Both virtual sites have essentially the same setup in the httpd-vhosts.conf file. For scottherrmann.loc: here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to log php error in a separate file? up vote 5 down vote favorite I just did an upgrade of my server to Fedora 17 and merged some configuration files containing .rpmnew into the existing ones. I have been successfully logging my php errors in a separate log file by keeping the following in php.ini: log_errors = On error_log = /var/log/php-errors.log I am not sure why the errors are being logged to /var/log/httpd/error_log after the upgrade despite keeping the settings above. Also, $ ls -l /var/log/php-errors.log -rwxrwxr--. 1 apache myself 232 Dec 13 16:49 /var/log/php-errors.log shows that apache did own the php error log file. What could be causing PHP errors to be logged into apache error log file? php apache-http-server error-logging share|improve this question asked Dec 17 '12 at 10:50 Question Overflow 3261518 migrated from stackoverflow.com Dec 17 '12 at 16:32 This question came from our site for professional and enthusiast programmers. @DaveRandom, from phpinfo(), it shows the loaded config file to be /etc/php.ini, which is correct. –Question Overflow Dec 17 '12 at 10:55 Have you tried setting the permissions on /var/log/php-errors.log to 666, in case the user/groups are not set up how you think they are? –DaveRandom Dec 17 '12 at 13:49 @DaveRandom, thanks for the suggestion. I tried, and it still send the error to apache error log. Even disabling SELinux does not help a bit :( –Question Overflow Dec 17 '12 at 13:59 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote PHP itself does not write to error_log since thats handled by Apache. PHP just throws them to Apache. You can set the log path in the .htaccess* share|improve this answer answered Dec 17 '12 at 10:52 Youri 1 1 PHP just what?? –Dr. Dan Dec 17 '12 at 10:56 A separate error log can be created by setting php.ini. I did that before. –Question Overflow Dec 17 '12 at 14:04 add a comment| up vote 0 down vote Try this, Enable PHP Error Logging via htaccess http://perishablepress.com/how-to-enable-php-error-logging-vi