編輯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();
?>
更多內容
>>本文地址:http://hqfphsz.com/zhuanye/2020/52923.html
聲明:本站稿件版權均屬中公教育優(yōu)就業(yè)所有,未經許可不得擅自轉載。
1 您的年齡
2 您的學歷
3 您更想做哪個方向的工作?