安装 EPEL 源
yum install epel-release
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
安装 Yum 源管理工具
yum install yum-utils
安装 PHP7.3
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xml
yum install php73-php-zip
设置开机启动、运行服务
systemctl enable php73-php-fpm
systemctl start php73-php-fpm
查看 PHP
php73 -v
查找php.ini位置
find / -name php.ini
更多操作
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
安装PHP7.4
yum install -y php74-php-fpm php74-php-cli php74-php-bcmath php74-php-gd php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-mysqlnd php74-php-opcache php74-php-pdo php74-php-pecl-crypto php74-php-pecl-mcrypt php74-php-pecl-geoip php74-php-recode php74-php-snmp php74-php-soap php74-php-xml
yum install php74-php-zip
设置开机启动、运行服务
systemctl enable php74-php-fpm
systemctl start php74-php-fpm
查看 PHP
php74 -v
查找php.ini位置
find / -name php.ini
更多操作
systemctl restart php74-php-fpm #重启
systemctl start php74-php-fpm #启动
systemctl stop php74-php-fpm #关闭
systemctl status php74-php-fpm #检查状态
linux php环境变量 软连接
- find / -name phpize 查看PHP 文件目录
- vim /etc/profile
添加 export PATH=$PATH:/www/server/php/73/bin (export PATH=$PATH:这里是你们的PHP 路径)
#php export PATH=$PATH:/opt/remi/php74/root/usr/bin
wq!保存退出 运行 source /etc/profile
- php -v