Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View apache error log in real time

Tags:

php

apache

I am building a PHP app using mod_php in apache. However during the course of development I will have syntax errors in the code (of course).

When I load the page with errors on I get a 500 page, if I want to view the actual error message I have to go into /var/log and cat the actual error log. This is quite annoying to do in development all the time.

I know that one can have errors show up on the web page, but this is not always convenient either when working with JSON etc and it messes up the page.

I know that with most python framework for example , error messages are just printed to stdout when the server application is run, however in this case since I am just attaching PHP to the apache service background process I don't see how that would be possible.

Is there some way to view the error logs in real time in a window with apache?

like image 976
user350325 Avatar asked May 17 '13 15:05

user350325


People also ask

How do I view the error log in Linux?

Open up a terminal window and issue the command cd /var/log. Now issue the command ls and you will see the logs housed within this directory (Figure 1).

Where can you find the Apache error log in cPanel?

For Dedicated hosting or VPS with cPanel installation, the Apache error log's location is /usr/local/apache/logs/error_log, where "error_log" is simply a plain text file. For Dedicated hosting or VPS without a cPanel installation, the Apache error log files are usually located in the /var/log/ directory.


1 Answers

tail -f /var/log/apache2/error.log
like image 94
bobwienholt Avatar answered Sep 29 '22 00:09

bobwienholt