Debugging errors in Drupal or anything running on Apache
Description
Had occasion to do a quick (read: emergency) debug session for a live site today, and as I remembered the steps for a change, wandering around on a server not our own, I share with them with the world repackaged as a debugging lesson:
$ cd /var/log/httpd/
-bash: cd: /var/log/httpd/: Permission denied
$ sudo tail -f /var/log/httpd/error.log
Password:
amos is not in the sudoers file. This incident will be reported.
$ su root
Password:
# cd /var/log/httpd/
# ls -la
...
-rw-r--r-- 1 root root 16210235 Apr 2 20:29 error_log
...
# tail -f error_logand that shows me a live stream of the most recent errors on the site.
There was the big old fatal error of a function not found.
A site administrator had disabled a module that was an undeclared dependency of another module. Point and click parse error the Drupal way!
The logs are also likely to live in cd /var/log/www and if you do have sudo access but not root access you can use sudo ls -la /var/log/www to see what's in there (the precise name of your error log file, you generally want the one without any numbers on it, that is the current one).
