zhuanzhou zhuanzhou - 1 year ago 64
Linux Question

Run PHP in Linux Command Line

I wrote a test file named

which path in CentOS is
. There is no browser, is there a way to run the file and see the output?

Answer Source


 - php /var/www/html/phpinfo.php
 - curl http://localhost/phpinfo.php

The first runs the script from commandline, the second fetches it from the webserver (this assumes you've configured it correctly)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download