centos系统下使用yum安装php7.4正式版,当前基于WLNMP提供的一键安装包来安装
0 更新环境
sudo yum update
yum install gcc gcc-c++ libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel libicu-devel freetype-devel openldap-devel
yum install yum-utils
1、添加epel源
yum install epel-release
2、添加WLNMP一键安装包源
rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
3、安装php7.4
yum clean all
yum install wphp74
启动方式
/etc/init.d/php-fpm74 restart
4、配置nginx
(1)如果使用WLNMP提供的nginx,只需要在nginx安装后取消include enable-php71.conf;取消注释即可
WLNMP安装nginx方法
yum install wnginx
(2)如果当前使用的是非WLNMP提供的nginx,只需要在nginx中配置以下内容即可
location ~ 1.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-fpm74.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
- / ↩
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。