Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the PHP built-in server error log location?

Tags:

I don't know if there's any. But does the PHP built in a web server also save its error logs in a file? For tailing purposes, like when creating virtual host in Apache.

I'm using Mac OS X.

like image 689
Bryan Estrito Avatar asked Nov 25 '14 08:11

Bryan Estrito


1 Answers

The built-in webserver doesn't log anywhere by default, so you need to provide a php.ini for it to customise this. For example, if you created a file called php.ini with this content:

error_log = /Users/me/test.log
log_errors = on
date.timezone = UTC

Then you can start PHP's built-in webserver like this:

php -S 127.0.0.1:8080 -c php.ini

And error_log() calls will be logged to the file you've specified.

like image 158
thenickdude Avatar answered Sep 21 '22 12:09

thenickdude