Category Archives: AWS

AWS elastic beanstalk PHP error log problems

I am currently setting up an php website instance in AWS elastic beanstalk and ran into some problems with the php_error.log from php. Here are my steps to solve.

  • Get SSH access to your instance
  • First create the log file $ sudo touch /var/log/php-error.log
  • Next edit php ini $ sudo vim /etc/php.ini
  • search for error_log ( esc : / error_log ) and change it to – error_log = /var/log/php-error.log
  • sudo chown -R elasticbeanstalk:elasticbeanstalk /var/log/php-error.log
  • sudo service httpd restart

That should get your php error log working! To test $ tail -f /var/log/php-error.log  . Now load a page with a error_log(‘what ok’);

To figure out what user your httpd is running under find this file and search for /etc/httpd/conf/httpd.conf and find “User”.