Iv. Configuration of Nginx support PHP

Source: Internet
Author: User

iv. configuration of nginx support PHP

Build a LNMP environment under Ubuntu. Compile and install mysql,nginx,php. Finally, install the composer under the Lnmp premise and install the Laravel frame. Fourth step, configure Nginx support PHP.

    1. first set up a directory to store Web page files, execute "sudo mkdri/usr/local/server/www". Then go to the directory, "cd/usr/local/server/www".

    2. Modify The nginx.confand execute the command "sudo vim/usr/local/server/nginx/conf/nginx.conf". Change the line to 2 as shown

    3. Figure 1

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/77/F1/wKiom1Zxg7DwsMbbAAAj6Auyz5A299.png "style=" float: none; "title=" 1.png "alt=" Wkiom1zxg7dwsmbbaaaj6auyz5a299.png "/>

Figure 2

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/77/F0/wKioL1Zxg7nQt4weAAA0b32AKls095.png "style=" float: none; "title=" 2.png "alt=" Wkiol1zxg7nqt4weaaa0b32akls095.png "/>

Remove the 65-71 comment and modify it to Figure 4:

Figure 3

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/F1/wKiom1Zxg7GBv9RDAABlxoIaUYY396.png "style=" float: none; "title=" 3.png "alt=" Wkiom1zxg7gbv9rdaablxoiauyy396.png "/>

Figure 4

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/77/F0/wKioL1Zxg7qRJVxqAACCYrK1bc8549.png "style=" float: none; "title=" 4.png "alt=" Wkiol1zxg7qrjvxqaaccyrk1bc8549.png "/>

3. Create a index.php file under/var/local/server/www, execute command: sudo vim/var/local/server/www/index.php, write the following in it; <?php Phpinfo ();? >

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/77/F1/wKiom1Zxg7LyrFw-AAA6X1e6RrM548.png "style=" float: none; "title=" 5.png "alt=" Wkiom1zxg7lyrfw-aaa6x1e6rrm548.png "/>

4. Restart the nginx. Execute command: Sudo/etc/init.d/nginx reload

5. open localhost in the browser, or an error in the nginx.conf configuration file if the following occurs.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/77/F1/wKiom1Zxg7LC5H8SAAA9INF6tGU202.png "style=" float: none; "title=" 6.png "alt=" Wkiom1zxg7lc5h8saaa9inf6tgu202.png "/>

Workaround: Modify the nginx.conf file.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/F0/wKioL1Zxg7vx538uAABlNdGjYNc783.png "style=" float: none; "title=" 7.png "alt=" Wkiol1zxg7vx538uaablndgjync783.png "/>

Then restart Nginx. Then open localhost in the browser.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/F1/wKiom1Zxg7SB0ihyAAEMPU_LdPg738.png "style=" float: none; "title=" 8.png "alt=" Wkiom1zxg7sb0ihyaaempu_ldpg738.png "/>

Since then, the configuration Nginx supports PHP completion.


This article from the "Good Learning Day Up" blog, please be sure to keep this source http://sunrising.blog.51cto.com/10729461/1725441

Iv. Configuration of Nginx support PHP

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.