Use of PHP built-in servers

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.