Print something in PHP built-in web server

Mohammad Efazati picture Mohammad Efazati · Jan 16, 2013 · Viewed 28.9k times · Source

In python built-in web server when use print in function, it prints result in terminal ...

for example:

Django version 1.3.4, using settings 'parsicore.settings'
Development server is running at http://0.0.0.0:8000/
Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
Quit the server with CONTROL-C.


127.0.0.1 - - [16/Jan/2013 02:02:08] "GET / HTTP/1.1" 200 -
hello ... print 1 2 3 

How can I print something like this in PHP built-in web server?

for example I want print $_POST in terminal. I use php -S 127.0.0.1:3000 for run PHP built-in web server.

Answer

acidjazz picture acidjazz · Apr 17, 2015

Just pipe your data to error_log():

error_log(print_r($_REQUEST, true));