이 글에서는 yum을 사용하여 CentOS7에 PHP7.3을 설치하는 방법을 소개합니다. 도움이 필요한 친구들이 모두 참고할 수 있기를 바랍니다.
CentOS 7 yum 설치 PHP7.3 튜토리얼
1. 먼저 EPEL 소스 설치:
yum install epel-release
REMI 소스 설치:
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
2 Yum 소스 관리 도구 설치:
yum install yum-utils
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 설정
설치 패키지 찾기:
[root@xxx etc]# rpm -qa | grep 'php'php73-php-cli-7.3.6-1.el7.remi.x86_64 php73-php-mbstring-7.3.6-1.el7.remi.x86_64 php73-php-pecl-mcrypt-1.0.2-1.el7.remi.x86_64 php73-runtime-2.0-1.el7.remi.x86_64 php73-php-pdo-7.3.6-1.el7.remi.x86_64 php73-php-bcmath-7.3.6-1.el7.remi.x86_64 php73-php-fpm-7.3.6-1.el7.remi.x86_64 php73-php-mysqlnd-7.3.6-1.el7.remi.x86_64 php73-php-snmp-7.3.6-1.el7.remi.x86_64 php73-php-gd-7.3.6-1.el7.remi.x86_64 php73-php-json-7.3.6-1.el7.remi.x86_64 php73-php-soap-7.3.6-1.el7.remi.x86_64 php73-php-recode-7.3.6-1.el7.remi.x86_64 php73-php-pecl-crypto-0.3.1-5.el7.remi.x86_64 php73-php-common-7.3.6-1.el7.remi.x86_64 php73-php-opcache-7.3.6-1.el7.remi.x86_64 php73-php-pecl-geoip-1.1.1-6.el7.remi.x86_64
발견: php73-php-fpm-7.3 .6-1.el7.remi.x86_64 설치 위치
[root@xxx etc]# rpm -ql php73-php-fpm-7.3.6-1.el7.remi.x86_64 /etc/logrotate.d/php73-php-fpm /etc/opt/remi/php73/php-fpm.conf /etc/opt/remi/php73/php-fpm.d /etc/opt/remi/php73/php-fpm.d/www.conf /etc/opt/remi/php73/sysconfig/php-fpm /etc/systemd/system/php73-php-fpm.service.d /opt/remi/php73/root/usr/sbin/php-fpm /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6 /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/php-fpm.conf.default /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/www.conf.default /opt/remi/php73/root/usr/share/fpm /opt/remi/php73/root/usr/share/fpm/status.html /opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6 /opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6/fpm_LICENSE /opt/remi/php73/root/usr/share/man/man8/php-fpm.8.gz /usr/lib/systemd/system/php73-php-fpm.service /var/opt/remi/php73/lib/php/opcache /var/opt/remi/php73/lib/php/session /var/opt/remi/php73/lib/php/wsdlcache /var/opt/remi/php73/log/php-fpm /var/opt/remi/php73/run/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 확인
설치 성공 여부 확인:
root@mf88.biz-service:~# php73 -v PHP 7.3.0-1+(cli) (built: Dec 6 2018 20:24:55) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
PHP 업데이트
다음 명령 시스템을 실행하면 모두 업데이트할 수 있습니다. 업데이트된 소프트웨어에는 PHP가 포함됩니다
yum update
추가 구성 요소 설치
위 명령은 PHP를 설치하며 일부 PHP 확장만 설치합니다.
# yum search php73 Updating Subscription Management repositories. Last metadata expiration check: 0:27:54 ago on Wed 15 May 2019 10:39:52 AM EDT. ============================================================================================= Name Exactly Matched: php73 ============================================================================================== php73.x86_64 : Package that installs PHP 7.3 php73.x86_64 : Package that installs PHP 7.3 ============================================================================================ Name & Summary Matched: php73 ============================================================================================= php73-syspaths.x86_64 : System-wide wrappers for the php73 package php73-syspaths.x86_64 : System-wide wrappers for the php73 package php73-scldevel.x86_64 : Package shipping development files for php73 php73-scldevel.x86_64 : Package shipping development files for php73 php73-php-zstd-devel.x86_64 : php73-php-zstd developer files (header) php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header) php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header) php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header) php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header) php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header) php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header) php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header) php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header) php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header) php73-php-pecl-swoole4-devel.x86_64 : php73-php-pecl-swoole4 developer files (header) php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header) php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers) php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers) php73-php-pecl-handlebars-devel.x86_64 : php73-php-pecl-handlebars developer files (header) ================================================================================================= Name Matched: php73 ================================================================================================== php73-php.x86_64 : PHP scripting language for creating dynamic web sites php73-php.x86_64 : PHP scripting language for creating dynamic web sites php73-build.x86_64 : Package shipping basic build configuration ……
권장 학습: PHP 비디오 튜토리얼
위 내용은 CentOS7에 yum을 사용하여 PHP7.3을 설치하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!