CentOS
安装 EPEL 源:
yum install epel-release
安装 REMI 源:
CentOS 7:
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-xmll
安装完成后最好重启一下计算机,不然有可能无法启动php
设置开机启动、运行服务:
systemctl enable php73-php-fpm
systemctl start php73-php-fpm
查找php.ini位置:
[root@xxx etc]# find /etc/opt/remi/php73 -name php.ini
/etc/opt/remi/php73/php.ini
编辑/etc/opt/remi/php73/php.ini替换换 ;cgi.fix_pathinfo=1 为 cgi.fix_pathinfo=0 快捷命令:
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
重启php73-php-fpm
systemctl restart php73-php-fpm
更多操作:
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
查看 PHP
验证一下是否安装成功:
php73 -v