Php Error Logs In Linux
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 of this site About Us Learn php error log ubuntu more about Stack Overflow the company Business Learn more about hiring developers or posting php.ini error log ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community php error log windows Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Where does PHP store the error log? (php5, apache, fastcgi,
Php Logarithm
cpanel) up vote 204 down vote favorite 45 I am on shared hosting and have Cpanel, Apache, PHP is run by fastcgi. Where does PHP store the error log? Is there any other way I can find the error log on shared hosting environment instead of having to go through entire site structure to look for error_log files? I have access to the php.ini (I am using PHP version php.ini error_log 5.2.16). error-handling php share|improve this question edited Aug 24 '15 at 9:33 n611x007 3,12522643 asked Feb 26 '11 at 15:43 PHPLOVER 1,986103045 8 On Linux, either /var/log/httpd/error_log or /var/log/apache2/error.log. These files are owned by root, so you need to be root or use sudo to see it, or read it. –Eric Leschinski Aug 7 '14 at 19:49 47 php --info | grep error –sjas Aug 27 '14 at 13:21 1 @sjas -- genius! –the0ther Feb 21 '15 at 20:02 3 For those looking for a Windows solution, use php --info | findstr /r /c:"error_log" to see where the log file is. –Boom May 13 '15 at 17:00 add a comment| 14 Answers 14 active oldest votes up vote 160 down vote accepted Php stores error logs in /var/log/apache2 if php is an apache2 module. Shared hosts are often storing log files in your root directory /log subfolder. But...if you have access to a php.ini file you can do this: error_log = /var/log/php-scripts.log According to rinogo's comment: If you're using cPanel, the master log file you're probably looking for is stored (by default) at /usr/local/apache/logs/error_log If all else fails you can check the location of the log file using
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 nginx php error log Stack Overflow the company Business Learn more about hiring developers or posting ads with
Php Debug Log
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Php Error_log No Value
a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP Show Error Logs on Linux [closed] up vote 0 down vote favorite I'm http://stackoverflow.com/questions/5127838/where-does-php-store-the-error-log-php5-apache-fastcgi-cpanel using PHP as scripting language to create web application. My question is how could I see error logs on linux? i forgot the comman, It's something like tail -f blabla php linux error-log share|improve this question asked Nov 13 '12 at 14:39 Bryan 65931330 closed as off topic by Brian, KevinDTimm, Sirko, Leo, mah Nov 13 '12 at 16:22 Questions on Stack Overflow are expected to relate to programming within http://stackoverflow.com/questions/13362679/php-show-error-logs-on-linux the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question. tail -f path/to/error_log –GBD Nov 13 '12 at 14:41 3 Depends on the location of the apache error log file. For example: tail -f /var/log/apache/error.log –Louis Huppenbauer Nov 13 '12 at 14:41 tail -n50 /var/log/apache2/error.log on debian –lynks Nov 13 '12 at 14:42 try: watch tail path/to/error/log
so you could see the changes in the file every 2 seconds! :) –jagc Jan 8 '14 at 8:29 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote Depends on your distribution and how Apache was installed (I assume you're using Apache). You should find the relevant log in /var/log or /var/log/httpd. Once you find the right log file, you could watch it with tail -f
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 http://unix.stackexchange.com/questions/57441/how-to-view-php-and-server-error-logs hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join http://serverfault.com/questions/250567/apache-error-log-with-php-errors 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 view php and server error logs? up php error vote 4 down vote favorite I am getting the WSOD now since editing settings.php; php.ini and .htaccess trying to update my site and I need to see error logs to find out what is happening. Also how do you clear cache in command line? Any help appreciated although haven't had much lately I have to admit. error-handling share|improve this question asked Dec 3 '12 at 12:11 freja 1474618 add a comment| 2 Answers 2 active oldest votes up vote 3 down php error log vote First of all: The logs for apache are set in the httpd.conf file. And the logs for PHP (if any) are set in the php.ini file. For the case of PHP, you have to look at the php.ini file, and look for log_errors and error_log variables, that must have these values: log_errors = On error_log = /tmp/php_error.log the last value (/tmp/php_error.log) is just an example. It must be a path to a secure location where you want to store the logs. Make sure that: these two lines are not commented, i.e.: they cannot have any ; before them. after the edit is done, restart apache to load these values. share|improve this answer edited Dec 3 '12 at 16:12 answered Dec 3 '12 at 13:05 nozimica 640419 error_reporting(E_ALL); ini_set('display_errors', '1'); –freja Dec 3 '12 at 13:46 read the above works as well but did not notice any errors in php.ini. I think I need to dump the database which I am also unsure of how to do without making a mess. –freja Dec 3 '12 at 13:48 add a comment| up vote 2 down vote In my experience, PHP's error messages will appear in Apache's error log by default. Try checking there (it's /var/log/apache2/error.log on Debian) for messages mentioning PHP. share|improve this answer answered Dec 3 '12 at 13:26 Brian Marshall 1414 1 I read that too and found a command to reveal error_
Start 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 Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. 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 Apache error log with PHP errors up vote 9 down vote favorite 3 I just set up PHP and Apache and would like to find where the errors are going. What is the default path of the error logs in apache for PHP? apache-2.2 php logging share|improve this question edited Sep 11 '11 at 6:53 Community♦ 1 asked Mar 22 '11 at 22:55 Genadinik 4782827 1 You havent mentioned what kind of operating system you're running apache on. Check your apache config for the location of logfiles. –pauska Mar 22 '11 at 22:59 I am using Ubuntu OS. –Genadinik Mar 22 '11 at 23:01 Which is the file that should contain this information by the way? - Thanks! –Genadinik Mar 22 '11 at 23:02 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote accepted There are the locations in these popular operating systems: RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - /var/log/httpd/error_log Debian / Ubuntu Linux Apache error log file location - /var/log/apache2/error.log FreeBSD Apache error log file location - /var/log/httpd-error.log The detailed answer about the Apache log files is here: http://www.cyberciti.biz/faq/apache-logs/ share|improve this answer edited Mar 23 '11 at 8:04 Hangin on in quiet desperation 88.4k9115201 answered Mar 22 '11 at 23:17 Genadinik 4782827 add a comment| up vote 2 down vote Try this: error_reporting = E_ALL | E_STRICT error_log = /var/log/php_errors.log Create log file manually touch /var/log/php_errors.log chown www-data: /var/log/php_errors.log chmod +rw /var/log/php_errors.log Now you can view PHP errors by this way tail /var/log/php_errors.log share|improve this answer answered Sep 7 '12 at 23:06 Nikolay Chuprina 1313 add a comment| Your Answer draft save