1
2
3
|
yum
install
nginx
service nginx start
chkconfig nginx on
|
1
2
3
|
yum
install
mysql mysql-server mysql-devel
service mysqld start
chkconfig mysqld on
|
1
2
3
4
5
|
yum
install
php php-mysql php-gd libjpeg* php-pear php-xml php-mbstring
php-mcrypt php-mhash libmcrypt libmcrypt-devel php-imap php-ldap php-odbc php-bcmath php-xmlrpc php-fpm
service mysqld restart
service nginx restart
service php-fpm start
|
1
2
3
4
5
6
7
8
9
10
11
|
vi
/etc/nginx/nginx
.conf
#修改运行用户
user nginx;
vi
/etc/nginx/conf
.d
/default
.conf
#开启php支持
index index.php index.html index.htm;
location ~ \.php$ {
root html;
#取消FastCGI server部分location的注释
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/usr/share/nginx/html/
$fastcgi_script_name;
#$document_root设置为网站根目录
include fastcgi_params;
}
|
1
2
|
date
.timezone = Asia
/Shanghai
#设置时区
expose_php = OFF
#禁止显示版本信息
|
1
2
3
|
vi
/etc/php-fpm
.d
/www
.conf
user = nginx
group = nginx
|
1
2
3
4
5
6
7
8
|
chown
-R nginx.nginx
/usr/share/nginx/html/
#设置目录所有者
chmod
774 -R
/usr/share/nginx/html/
#设置目录权限
service mysqld restart
service nginx restart
service php-fpm restart
cd
/usr/share/nginx/html/
vi
index.php
<?Php phpinfo();?>
|