1.命令内容yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
2.命令执行结果
二.安装Nginx1.使用yum安装,命令为:
yum install -y nginx
下图是执行结果:
如果出现如下错误:
请先安装epel:1.使用命令:yum install -y epel-release
2.使用命令:rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
安装好epel后再安装nginx
2.验证是否安装成功,尝试启动nginx
service nginx start
三.安装PHP及若干扩展
1.使用yum安装phpyum install -y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm
2.启动php-fpm/etc/rc.d/init.d/php-fpm start
3.设置开机启动项chkconfig php-fpm on
四.配置Nginx支持PHP1.备份php-fpm的配置文件cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.confbak2.修改配置文件vim /etc/php-fpm.d/www.conf#修改用户为nginxuser = nginx#修改组为nginxgroup = nginx五.安装Mysql
1.使用yum直接安装mysql
yum -y install mysql mysql-server
2.启动Mysql,验证Mysql安装是否成功service mysqld start
3.设置开机启动项chkconfig mysqld on六.附Nginx、Mysql、PHP重启命令#重启nginxservice nginx restart#重启mysqlservice mysqld restart#重启php
/etc/rc.d/init.d/php-fpm restart
本文出自 “PHP相关技术博文” 博客,请务必保留此出处http://junstar.blog.51cto.com/4551565/1677140
Linux下Nginx+PHP+Mysql环境搭建过程(图文)
标签:linux mysql php 环境安装 nginx
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:http://junstar.blog.51cto.com/4551565/1677140