centos7 install lnmp
yum install epel-release
yum install php php-fpm nginx mariadb-devel mariadb-server mariadb
test php 模块
vim /etc/nginx/nginx.conf
notice:在location 下面添加这一行就可以
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
最后:在nginx网站的根目录添加01.php 文件
vi 01.php
<?php
phpinfo();
?>
原文地址:https://www.cnblogs.com/S--S/p/9058344.html
时间: 2024-11-06 07:11:16