Use logging with PHP's built-in web server

Write to the php built-in web server's log.

// index.php
error_log(json_encode($_GET), 4);
$ php -S index.php
$ curl -i ""
HTTP/1.1 200 OK
Connection: close
X-Powered-By: PHP/5.6.5
Content-type: text/html; charset=UTF-8
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment