1, 下载PHP74, sudo yum list installed|grep php sudo yum remove php* -y sudo yum install https://dl.fedoraproject.org/p
1, 下载PHP74,
sudo yum list installed|grep php
sudo yum remove php* -y
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
sudo yum install -y Http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum -y install php74 php74-php-devel
sudo yum install php74-php-fpm
php74 -v
2, 配置php.ini:
;cgi.fix_pathinfo=1
删除分号改为:cgi.fix_pathinfo=0
3, 配置Nginx.conf
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
4, 启动php-fpm:
/opt/remi/php74/root/usr/sbin/php-fpm
5, 网页打开php文件出现No input file specified.
改PHP.ini中的doc_root行,打开ini文件注释掉此行
保证更改php.ini
首先保证php.ini的配置中把
;cgi.fix_pathinfo=1 改为
cgi.fix_pathinfo=0
重启PHP或PHP-FPM
在nginx.conf 找到:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 改为:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
重启nginx【killall -9 nginx, systemctl restart nginx】解决
来源地址:https://blog.csdn.net/qq_49416650/article/details/129692759
--结束END--
本文标题: 腾讯云Centos系统配置nginx+php74+php-fpm
本文链接: https://lsjlt.com/news/403737.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0