Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed Apache, PHP, and MySQL on Ubuntu 10.10 desktop edition, and it's working fine.
Except I have no clue where to look for Apache or PHP log files.

share|improve this question
up vote 144 down vote accepted

By default, /var/log/apache2/error.log.

This can be configured in /etc/php5/apache2/php.ini.

share|improve this answer
Yep. got it. it was a bit different on windows. – Stann Nov 24 '10 at 19:38

Check these settings in php.ini:

  1. error_reporting = E_ALL | E_STRICT (as recommended for development in php.ini)
  2. error_log = /var/log/php_errors.log
  3. Then 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

This is an agreeable solution to this issue for me.

share|improve this answer
perfect step-by-step solution – Mark Fox Feb 15 '14 at 6:15
would also need a step to restart the apache for settings to take effect – rbawaskar Oct 13 '14 at 10:32
this should be the accepted answer – Martin Duys May 6 '15 at 6:00

You can also define a specific error log file for each VirtualHost in Apache. If you have any VirtualHost defined in /etc/apache2/sites-available/ and enabled in /etc/apache2/sites-enabled (enable with sudo a2ensite [your-virtualhost-definition-file]), you can change the error log by adding the following line inside your VirtualHost config:

ErrorLog ${APACHE_LOG_DIR}/[your-vhost]-error.log

That might be useful if you have a lot of vhosts and want to split where they report the errors.

Also, you can watch your error log live by issuing the following command (adapt to your own log file if different from the default):

sudo tail -f /var/log/apache2/error.log

This is particularly useful when doing live debugging.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.