阿里云LNMP服务器简易安装配置,阿里lnmp安装配置
环境:Centos7.x+PHP7.0+Nginx+Mysql连接驱动
cd /etc/nginx/conf.d
vi www.xxx.com.conf
listen 80;
server_name www.xxx.com;
root /home/wwwdata/www.xxx.com/frontend/web;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
-
service nginx restart
-
cd /home/wwwdata/www.xxx.com/frontend/web
-
vi test.html:xxx
-
访问网站http://www.xxx.com/test.html,如可访问,则nginx安装运行正常
安装PHP7、MySQL及扩展
安装 PHP 扩展(此处可以yum search php70w看看需要哪些扩展)
yum install php70w-cli php70w-gd php70w-mysqlnd php70w-pdo php70w-mcrypt php70w-mbstring php70w-json php70w-opcache php70w-xml php70w-intl php70w-pecl-apcu php70w-devel -y
重新加载php-fpm:systemctl reload php-fpm
session问题:
重启nginx: service nginx restart
重启php-fpm: service php-fpm restart压力测试
评论暂时关闭