How do I run PHP without a third-party Web service?

Source: Internet
Author: User

Recently, I accidentally discovered PHP's own Web server functionality.       So it was a bit of experimentation. 650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9B/0E/wKiom1ldsMbBnscNAAHSTTBk0kY292.png "title=" 2017-07-06 11-37-43 screen. png "alt=" Wkiom1ldsmbbnscnaahsttbk0ky292.png "/>

As you can see, the following parameters are available in the PHP command-line mode:

-S <addr>:<port> Run with built-in Web server.
-T <docroot> specify document root <docroot> for built-in Web server.


Explain:
-S access address: Port//Run PHP via built-in Web service
-T site root//Specify Web service's Web root directory


So, moving small hands, the world I have.


1. Start the built-in Web service:

[Email protected]:~$ php-s localhost:8080-t ~/www/zhangrenjie_test/test/php 7.0.18-0ubuntu0.16.04.1 Development Server started at Thu Jul 6 11:31:12 2017Listening on http://localhost:8080Document root is/home/zrj/www/zhangrenjie_tes T/testpress ctrl-c to quit. [Thu Jul 6 11:31:26] 127.0.0.1:50692 [[]:/12.php[thu Jul 6 11:31:29] 127.0.0.1:50696 []:/11.php

2. Browser access:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9B/0F/wKiom1ldsy2wMFhpAAA5AJdILxk645.png "title=" 2017-07-06 11-48-33 screen. png "alt=" Wkiom1ldsy2wmfhpaaa5ajdilxk645.png "/>


Mastering this skill, from then on, can no longer worry about the experimental environment.

This article is from the "My PHP path" blog, so be sure to keep this source http://phpme.blog.51cto.com/663593/1944953

How do I run PHP without a third-party Web service?

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.