编辑Apache配置文件
vi /etc/httpd/conf/httpd.conf
安装PHP7.4 FastCGI进程
php-fpm = php fastcgi process manager
yum --enablerepo=remi-php74 install php-fpm
systemctl enable php-fpm
systemctl start php-fpm
systemctl status php-fpm
安装配置NGINX1.6
CentOS7光盘自带
yum install nginx
编辑配置文件:
vi /etc/nginx/nginx.conf
添加内容:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
location ~ .php$ {
try_files $uri =404;
root /var/www/html; #nginx使用apache的web目录,可根据情况自行指定
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
error_page 404 /404.html;
location = /40x.html {
}
......
编辑测试php文件:
vi /var/www/html/info.php
phpinfo();
?>