User login

Debugging errors in Drupal or anything running on Apache

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_log

and 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).

Resolution

Searched words: 
find Apache error log

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.