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?
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).
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.
tail -f /var/log/apache2/error.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With