About the use of PHP's built-in server today, I started to officially learn PHP (I have learned a little before). The recommended website for learning is w3school. at first, I did not know that the tomcat server does not support PHP scripts. the php file is put into tomcat to run. The php code segment embedded in the result has no results. Later, I found out that Tomact cannot parse the php code. However, it seems that you can perform some configuration in Tomact. The Tomact server is installed on my computer, but it is not configured yet. Apache or IIS is not used either. Instead, use the PHP built-in server. The PHP built-in server seems to be available in version 5.4.0 or later.
I just conducted a test. Summarize it again.
1. Download PHP. The download address is https://secure.php.net/downloads.php. Then select a directory to decompress the package. Directory to be decompressed: E: \ eclipseAll \ php.
2. run cmd to open the DOS command window. Enter the decompressed PHP directory. Because my directory structure is relatively simple. So it is first-level.
3. consider future studies. I created a directory for storing. php code: E: \ PHP \ Test.
4. enter the following in the doscommand window:
php -S localhost:8000 -t /PHP/Test
Note: The parameters after t are the directories created for the. php code. Because the directory where my doscommand is located is E: \ eclipseAll \ php,/PHP/Test is to find the PHP directory from the root directory of the E disk and then search for Test.
5. enter the command in step 4 and press enter to display:
6. create a Test. PHP file in the E: \ PHP \ Test Directory and save the file.
8. enter http: // localhost: 8000/Test. php in the address bar of the browser to access the content in Test. php.
9. now, the first. php code can run. These steps are simple for the use of PHP built-in servers. it is enough for preliminary study. If you have any problems later, or you want to install Apach and other servers, you will also update and summarize them.
Note: This article is just a summary of your own learning. If you have any mistakes, please correct them and learn from each other. If someone thinks it is too rough or too simple, ignore it. Thank you.