Building Chinese Web Sites using PHP - Version 2.14, by Dr. Herong Yang
Running PHP Scripts
This section describes how to run PHP scripts in a command window in normal mode and in CGI mode.
PHP scripts can be executed with two different command interfaces:
To do a quick test with both interfaces, I wrote the following simple script, hello.php, with a text editor:
Hello <?php echo "world!"; ?>
I used the \local\php\php.exe to execute this script in a command window:
C:\>\local\php\php hello.php Hello world!
I then the \local\php\php-cgi.exe to execute this script in a command window:
>\php\php-cgi Hello.php Content-type: text/html X-Powered-By: PHP/5.0.4 Hello world!
PHP CGI, php-cgi.exe, generated the HTTP response header as required by the Web server.
To learn more about running PHP scripts, read my other book: PHP Tutorials - Herong's Tutorial Notes
Last update: 2015.
Table of Contents