PHP Error Logs in Heroku
After a lot of experimentation, it looks like you need to comment out error_log
in php.ini and make sure log_errors = on
.. this should output your errors to stderr where the heroku logplex can pick up the stream, then monitor with heroku logs --tail
.. I launched a heroku facebook app and looked at their phpinfo() and copied the setup.
Try adding:
error_reporting(E_ALL);ini_set("display_errors", 1);
To the very top of your PHP page/app
We had to add this to our buildpack in the bin/compile file:
cat >>boot.sh <<EOFfor var in \`env|cut -f1 -d=\`; do echo "PassEnv \$var" >> /app/apache/conf/httpd.conf;donetouch /app/apache/logs/error_logtouch /app/apache/logs/access_logtouch /app/apache/logs/php_error.logtail -F /app/apache/logs/error_log &tail -F /app/apache/logs/access_log &tail -F /app/apache/logs/php_error.log &echo "Launching apache"exec /app/apache/bin/httpd -DNO_DETACHEOF
We left the php.ini and https.conf settings mostly as-is.