centos6.7 System Source Installation Nginx+php+mysql

Source: Internet
Author: User
Tags fpm install php

Environment: CentOS Release 6.7 (Final)
Installation software: nginx+mysql+php

Installation Tool: Yum

1. Install Nginx, because the default Yum base source is not nginx, so this way to add Nginx official source to the local

1) Address: http://nginx.org/en/linux_packages.html download system corresponding to Yum, such as

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/04/wKiom1YwigCjowoCAAGzfDqU9ps118.jpg "style=" width : 561px;height:300px; "title=" Screenshot-1.png "alt=" wkiom1ywigcjowocaagzfdqu9ps118.jpg "border=" 0 "height=" 300 " Hspace= "0" vspace= "0" width= "561"/>

2.) Configure the Yum source,

A.vim/etc/yum.repos.d/nginx.repo and add the following content

[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/centos/6/x86_64/
Gpgcheck=0
Enabled=1

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/02/wKioL1Ywi7nRsS1aAADCx7fUvoc900.jpg "style=" width : 520px;height:180px; "title=" Screenshot-2.png "alt=" wkiol1ywi7nrss1aaadcx7fuvoc900.jpg "border=" 0 "height=" 180 " Hspace= "0" vspace= "0" width= "520"/>


3.) Yum install Nginx and verify

A. View the installed Nginx information

650) this.width=650; "style=" width:500px;height:300px; "src=" http://s3.51cto.com/wyfs02/M01/75/02/ Wkiol1ywjuprokmwaatahygxley893.jpg "title=" Screenshot-3.png "alt=" wkiol1ywjuprokmwaatahygxley893.jpg "border=" 0 " height= "hspace=" 0 "vspace=" 0 "width="/> "

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/02/wKioL1YwjWmgNZRlAADwkpIhIXo247.jpg "title=" Screenshot-5.png "alt=" Wkiol1ywjwmgnzrlaadwkpihixo247.jpg "/>

650) this.width=650; "style=" width:250px;height:250px; "src=" http://s3.51cto.com/wyfs02/M01/75/04/ Wkiom1ywjtbby0ecaai0-ozbxao608.jpg "title=" Screenshot-4.png "alt=" wkiom1ywjtbby0ecaai0-ozbxao608.jpg "border=" 0 " height= "hspace=" 0 "vspace=" 0 "width="/> "

2. Install MySQL

yum install mysql mysql-server mysql-devel

         service mysqld start          chkconfig mysqld on //设置mysql开机启动

         mysql_secure_installation //对mysql进行一系列的安全设置

3.安装php

     yum  -y install php  php-cli php-mysql php-gd php-imap php-ldap

  php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap


4.安装php-fpm 使php支持fascCGI模式

    yum install  php-tidy php-common php-devel php-fpm php-mysql

    service php-fpm start

5.配置nginx支持php

    1).修改之前备份配置文件

         cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak

         cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak

    2).修改/etc/nginx/conf.d/default.conf在在Server下增加index.php如同

     650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/75/05/wKiom1Ywj5nxJD5XAADbvFIK4as729.jpg" style="width:473px;height:229px;" title="Screenshot-6.png" alt="wKiom1Ywj5nxJD5XAADbvFIK4as729.jpg" border="0" height="229" hspace="0" vspace="0" width="473" />

3). Uncomment the location column of the root directory,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/75/02/wKioL1YwkBejKCI1AAGp6_eWZnc554.jpg "style=" float: right;width:650px;height:300px; "title=" Screenshot-7.png "alt=" wkiol1ywkbejkci1aagp6_ewznc554.jpg "border=" 0 " height= "hspace=" 0 "vspace=" 0 "width=" 650 "/>












4). Configure the PHP-FPM profile to be backed up before vim/etc/php-fpm.d/www.conf configuration, modify user = Nginx and group = Nginx by default (user = Apache,group = Apache),

650) this.width=650; "style=" float:left; "src=" http://s3.51cto.com/wyfs02/M01/75/05/ Wkiom1ywknbsqnrtaaebohqtjx4841.jpg "title=" Screenshot-8.png "alt=" Wkiom1ywknbsqnrtaaebohqtjx4841.jpg "/>

5) Restart Nginx and Php-fpm,mysql test results,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/02/wKioL1YwkYHgGj5vAAOrnr2uObU879.jpg "style=" float: Left; "title=" Screenshot-9.png "alt=" Wkiol1ywkyhggj5vaaornr2uobu879.jpg "/>


This article is from the "Wizarding Network" blog, so be sure to keep this source http://whitehat.blog.51cto.com/3902359/1707361

centos6.7 System Source Installation Nginx+php+mysql

Related Article

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.