Server Fault is a question and answer site for system and network administrators. 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

Currently my web application can print error when host on my local machine.

When I host it on Amazon EC2 server. The error page is empty/blank.

I want to see the error stack trace when run on EC2, how can I do that?

I'm using Ubuntu Natty 11.04 and LAMP Stack on my EC2.

share|improve this question
up vote 2 down vote accepted

Can you post the contents of php.ini? This looks like a configuration issue. We will need to check that the web server can find the error log you defined in php.ini and that the web server has permissions to write to it. PHP silently fails if either condition isn't met...

share|improve this answer is my phpinfo – Nam G VU Dec 13 '11 at 18:28
You're not specifying an absolute path to the error log. This means that the webserver will asume that the error log is in document_root. (Someone correct me if I'm wrong)Try putting in path to the apache logs dir, restarting the server, and see if you get output. – Mina Dec 15 '11 at 11:58
@Mideiane I appreciate your help a lot. Though, if it were with more full information, I'll choose your answer as accepted. Thank you a lot! It's now works with full path. – Nam G VU Jan 18 '12 at 14:04
@NamGiVU hm. OK. – Mina Mar 9 '12 at 13:45

Open the php.ini file and change the following directives so it looks like this.

display_errors = On
error_reporting = E_ALL

Then restart Apache and do something to cause an error, such as manually call trigger_error('Test'); on a page.

You should be aware this is bad practice for a production website. These settings are fine in dev, where you want errors to be blatantly obvious, but for production you should be logging errors to a file which you review. This log file is defined with the error_log directive.

share|improve this answer
It's great. I think I better go with the error_log option. – Nam G VU Dec 11 '11 at 9:01
I tried to alter my php.ini at /etc/php5/apache2/php.ini to include error_log = php_errors.log, display_errors = On, error_reporting = E_ALL; then I restart Apache via sudo /etc/init.d/apache2 restart. Then I refresh the error page: I can see the error printed on my web but I found no lines in /etc/php5/apache2/php_errors.log. Please help – Nam G VU Dec 11 '11 at 9:03
The error in your page is identical to what you'd get in the error log anyways. – thinice Dec 12 '11 at 15:50

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.