centos7 install lnmp

 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();

?>

猜你喜欢

转载自www.cnblogs.com/S--S/p/9058344.html