![다른 버전의 PHP를 설치하려면 centos 7에서 아래 단계를 따르십시오.](https://linux55.com/image/130709/%EB%8B%A4%EB%A5%B8%20%EB%B2%84%EC%A0%84%EC%9D%98%20PHP%EB%A5%BC%20%EC%84%A4%EC%B9%98%ED%95%98%EB%A0%A4%EB%A9%B4%20centos%207%EC%97%90%EC%84%9C%20%EC%95%84%EB%9E%98%20%EB%8B%A8%EA%B3%84%EB%A5%BC%20%EB%94%B0%EB%A5%B4%EC%8B%AD%EC%8B%9C%EC%98%A4..png)
다음 명령을 실행했습니다.
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --enable remi-php70
이 단계에서는 오류가 없습니다.
내가 실행할 때 :
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
나는 가지고있다:
Loaded plugins: fastestmirror, universal-hooks
remi-php70 | 2.9 kB 00:00:00
remi-php70/primary_db | 208 kB 00:00:00
Loading mirror speeds from cached hostfile
* EA4: 85.13.201.2
* cpanel-addons-production-feed: 85.13.201.2
* base: centos.mirrors.ovh.net
* epel: mirror.nl.leaseweb.net
* extras: centos.mirrors.ovh.net
* remi-php70: remi.mirror.wearetriple.com
* remi-safe: remi.mirror.wearetriple.com
* updates: centos.mirrors.ovh.net
No package php available.
No package php-mcrypt available.
No package php-cli available.
No package php-gd available.
No package php-curl available.
No package php-mysql available.
No package php-ldap available.
No package php-zip available.
No package php-fileinfo available.
Error: Nothing to do
실행했습니다. yum clean all
그런 다음 이전 명령을 다시 실행했지만 아무것도 변경되지 않았습니다.
검색해 보니 yum search php7
많은 패키지를 보았지만 결정을 내릴 만큼 지식이 부족했습니다.
제안을 환영합니다!
편집 1
이는 다음 명령을 실행한 결과입니다 yum search php7
.
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 85.13.201.2
* cpanel-addons-production-feed: 85.13.201.2
* base: centos.mirrors.ovh.net
* epel: mirror.nl.leaseweb.net
* extras: centos.mirrors.ovh.net
* remi-php70: remi.mirror.wearetriple.com
* remi-safe: remi.mirror.wearetriple.com
* updates: centos.mirrors.ovh.net
================================================================================================ N/S matched: php7 ================================================================================================
ea-php70-libc-client-debuginfo.x86_64 : Debug information for package ea-php70-libc-client
ea-php70-php-debuginfo.x86_64 : Debug information for package ea-php70-php
ea-php70-php-ioncube6-debuginfo.x86_64 : Debug information for package ea-php70-php-ioncube6
ea-php70-runtime.x86_64 : Package that handles ea-php70 Software Collection.
ea-php70-scldevel.x86_64 : Package shipping development files for ea-php70
ea-php71-libc-client-debuginfo.x86_64 : Debug information for package ea-php71-libc-client
ea-php71-php-debuginfo.x86_64 : Debug information for package ea-php71-php
ea-php71-runtime.x86_64 : Package that handles ea-php71 Software Collection.
ea-php71-scldevel.x86_64 : Package shipping development files for ea-php71
ea-php72-libc-client-debuginfo.x86_64 : Debug information for package ea-php72-libc-client
ea-php72-php-debuginfo.x86_64 : Debug information for package ea-php72-php
ea-php72-runtime.x86_64 : Package that handles ea-php72 Software Collection.
ea-php72-scldevel.x86_64 : Package shipping development files for ea-php72
ea-php70.x86_64 : Package that installs PHP 7.0
ea-php70-build.x86_64 : Package shipping basic build configuration
ea-php70-libc-client.x86_64 : UW C-client mail library
ea-php70-libc-client-devel.x86_64 : Development tools for programs which will use the UW IMAP library
ea-php70-libc-client-static.x86_64 : UW IMAP static library
ea-php70-pear.noarch : PHP Extension and Application Repository framework
ea-php70-php.x86_64 : PHP DSO
ea-php70-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php70-php-bz2.x86_64 : A module for PHP applications that interface with .bz2 files
ea-php70-php-calendar.x86_64 : A module for PHP applications that need date/time calculations
ea-php70-php-cli.x86_64 : Command-line interface for PHP
ea-php70-php-common.x86_64 : Common files for PHP
ea-php70-php-curl.x86_64 : A module for PHP applications that need to interface with curl
ea-php70-php-dba.x86_64 : A database abstraction layer module for PHP applications
ea-php70-php-dbg.x86_64 : The interactive PHP debugger
ea-php70-php-devel.x86_64 : Files needed for building PHP extensions
ea-php70-php-enchant.x86_64 : Enchant spelling extension for PHP applications
ea-php70-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php70-php-fileinfo.x86_64 : A module for PHP applications that need to detect file types
ea-php70-php-fpm.x86_64 : PHP FastCGI Process Manager
ea-php70-php-ftp.x86_64 : A module for PHP applications that need full FTP protocol support
ea-php70-php-gd.x86_64 : A module for PHP applications for using the gd graphics library
ea-php70-php-gettext.x86_64 : A module for PHP applications that need native language support
ea-php70-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library
ea-php70-php-iconv.x86_64 : A module for PHP applications that need to convert character sets
ea-php70-php-imap.x86_64 : A module for PHP applications that use IMAP
ea-php70-php-intl.x86_64 : Internationalization extension for PHP applications
ea-php70-php-ioncube10.x86_64 : Experimental v10 Loader for ionCube-encoded PHP files
ea-php70-php-ioncube6.x86_64 : Experimental v6 Loader for ionCube-encoded PHP files
ea-php70-php-ldap.x86_64 : A module for PHP applications that use LDAP
ea-php70-php-litespeed.x86_64 : LiteSpeed Web Server PHP support
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
ea-php70-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
ea-php70-php-odbc.x86_64 : A module for PHP applications that use ODBC databases
ea-php70-php-opcache.x86_64 : The Zend OPcache
ea-php70-php-pdo.x86_64 : A database access abstraction module for PHP applications
ea-php70-php-pgsql.x86_64 : A PostgreSQL database module for PHP
ea-php70-php-phalcon.x86_64 : A full-stack PHP framework delivered as a C-extension
ea-php70-php-posix.x86_64 : Modules for PHP scripts that need access to POSIX functions
ea-php70-php-process.x86_64 : Modules for PHP script using system process interfaces
ea-php70-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces
ea-php70-php-recode.x86_64 : A module for PHP applications for using the recode library
ea-php70-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
ea-php70-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol
ea-php70-php-sockets.x86_64 : A module for PHP applications that need low-level access to sockets
ea-php70-php-sourceguardian.x86_64 : Loader for SourceGuardian-encoded PHP files
ea-php70-php-tidy.x86_64 : Standard PHP module provides tidy library support
ea-php70-php-xml.x86_64 : A module for PHP applications which use XML
ea-php70-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
ea-php70-php-zip.x86_64 : A module for PHP applications that need to handle .zip files
ea-php71.x86_64 : Package that installs PHP 7.1
ea-php71-build.x86_64 : Package shipping basic build configuration
ea-php71-libc-client.x86_64 : UW C-client mail library
ea-php71-libc-client-devel.x86_64 : Development tools for programs which will use the UW IMAP library
ea-php71-libc-client-static.x86_64 : UW IMAP static library
ea-php71-pear.noarch : PHP Extension and Application Repository framework
ea-php71-php.x86_64 : PHP DSO
ea-php71-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php71-php-bz2.x86_64 : A module for PHP applications that interface with .bz2 files
ea-php71-php-calendar.x86_64 : A module for PHP applications that need date/time calculations
ea-php71-php-cli.x86_64 : Command-line interface for PHP
ea-php71-php-common.x86_64 : Common files for PHP
ea-php71-php-curl.x86_64 : A module for PHP applications that need to interface with curl
ea-php71-php-dba.x86_64 : A database abstraction layer module for PHP applications
ea-php71-php-dbg.x86_64 : The interactive PHP debugger
ea-php71-php-devel.x86_64 : Files needed for building PHP extensions
ea-php71-php-enchant.x86_64 : Enchant spelling extension for PHP applications
ea-php71-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php71-php-fileinfo.x86_64 : A module for PHP applications that need to detect file types
ea-php71-php-fpm.x86_64 : PHP FastCGI Process Manager
ea-php71-php-ftp.x86_64 : A module for PHP applications that need full FTP protocol support
ea-php71-php-gd.x86_64 : A module for PHP applications for using the gd graphics library
ea-php71-php-gettext.x86_64 : A module for PHP applications that need native language support
ea-php71-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library
ea-php71-php-iconv.x86_64 : A module for PHP applications that need to convert character sets
ea-php71-php-imap.x86_64 : A module for PHP applications that use IMAP
ea-php71-php-intl.x86_64 : Internationalization extension for PHP applications
ea-php71-php-ioncube10.x86_64 : Experimental v10 Loader for ionCube-encoded PHP files
ea-php71-php-ldap.x86_64 : A module for PHP applications that use LDAP
ea-php71-php-litespeed.x86_64 : LiteSpeed Web Server PHP support
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
ea-php71-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
ea-php71-php-odbc.x86_64 : A module for PHP applications that use ODBC databases
ea-php71-php-opcache.x86_64 : The Zend OPcache
ea-php71-php-pdo.x86_64 : A database access abstraction module for PHP applications
ea-php71-php-pgsql.x86_64 : A PostgreSQL database module for PHP
ea-php71-php-phalcon.x86_64 : A full-stack PHP framework delivered as a C-extension
ea-php71-php-posix.x86_64 : Modules for PHP scripts that need access to POSIX functions
ea-php71-php-process.x86_64 : Modules for PHP script using system process interfaces
ea-php71-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces
ea-php71-php-recode.x86_64 : A module for PHP applications for using the recode library
ea-php71-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
ea-php71-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol
ea-php71-php-sockets.x86_64 : A module for PHP applications that need low-level access to sockets
ea-php71-php-tidy.x86_64 : Standard PHP module provides tidy library support
ea-php71-php-xml.x86_64 : A module for PHP applications which use XML
ea-php71-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
ea-php71-php-zip.x86_64 : A module for PHP applications that need to handle .zip files
ea-php72.x86_64 : Package that installs PHP 7.2
ea-php72-build.x86_64 : Package shipping basic build configuration
ea-php72-libc-client.x86_64 : UW C-client mail library
ea-php72-libc-client-devel.x86_64 : Development tools for programs which will use the UW IMAP library
ea-php72-libc-client-static.x86_64 : UW IMAP static library
ea-php72-pear.noarch : PHP Extension and Application Repository framework
ea-php72-php.x86_64 : PHP DSO
ea-php72-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php72-php-bz2.x86_64 : A module for PHP applications that interface with .bz2 files
ea-php72-php-calendar.x86_64 : A module for PHP applications that need date/time calculations
ea-php72-php-cli.x86_64 : Command-line interface for PHP
ea-php72-php-common.x86_64 : Common files for PHP
ea-php72-php-curl.x86_64 : A module for PHP applications that need to interface with curl
ea-php72-php-dba.x86_64 : A database abstraction layer module for PHP applications
ea-php72-php-dbg.x86_64 : The interactive PHP debugger
ea-php72-php-devel.x86_64 : Files needed for building PHP extensions
ea-php72-php-enchant.x86_64 : Enchant spelling extension for PHP applications
ea-php72-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php72-php-fileinfo.x86_64 : A module for PHP applications that need to detect file types
ea-php72-php-fpm.x86_64 : PHP FastCGI Process Manager
ea-php72-php-ftp.x86_64 : A module for PHP applications that need full FTP protocol support
ea-php72-php-gd.x86_64 : A module for PHP applications for using the gd graphics library
ea-php72-php-gettext.x86_64 : A module for PHP applications that need native language support
ea-php72-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library
ea-php72-php-iconv.x86_64 : A module for PHP applications that need to convert character sets
ea-php72-php-imap.x86_64 : A module for PHP applications that use IMAP
ea-php72-php-intl.x86_64 : Internationalization extension for PHP applications
ea-php72-php-ioncube10.x86_64 : Experimental v10 Loader for ionCube-encoded PHP files
ea-php72-php-ldap.x86_64 : A module for PHP applications that use LDAP
ea-php72-php-litespeed.x86_64 : LiteSpeed Web Server PHP support
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
ea-php72-php-odbc.x86_64 : A module for PHP applications that use ODBC databases
ea-php72-php-opcache.x86_64 : The Zend OPcache
ea-php72-php-pdo.x86_64 : A database access abstraction module for PHP applications
ea-php72-php-pgsql.x86_64 : A PostgreSQL database module for PHP
ea-php72-php-posix.x86_64 : Modules for PHP scripts that need access to POSIX functions
ea-php72-php-process.x86_64 : Modules for PHP script using system process interfaces
ea-php72-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces
ea-php72-php-recode.x86_64 : A module for PHP applications for using the recode library
ea-php72-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
ea-php72-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol
ea-php72-php-sockets.x86_64 : A module for PHP applications that need low-level access to sockets
ea-php72-php-tidy.x86_64 : Standard PHP module provides tidy library support
ea-php72-php-xml.x86_64 : A module for PHP applications which use XML
ea-php72-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
ea-php72-php-zip.x86_64 : A module for PHP applications that need to handle .zip files
Name and summary matches only, use "search all" for everything.
답변1
이 시도:
yum install php73.x86_64 ea-php73-php-intl.x86_64
yum install php73.x86_64 ea-php73-php-soap.x86_64
yum install php73.x86_64 ea-php73-php-zip.x86_64
등.
답변2
Remi 저장소를 다양한 버전의 PHP 설치를 위한 기본 저장소로 활성화하려면 yum-config-manager를 사용하십시오. 다음 예에서는 Remi 저장소를 활성화합니다.
Yum 설치 http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --remi-php73 활성화
PHP 73 설치 예 및 모든 필수 모듈은 PHP 73을 설치할 때 설치됩니다. PHP 7.3에는 다음 패키지가 필요합니다.
냠 설치 PHP php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
답변3
다음 명령을 내리세요:
yum install php70 php70-mcrypt php70-cli php70-gd php70-curl php70-mysql php70-ldap php70-zip php70-fileinfo
그리고 확인
답변4
다른 버전의 PHP를 설치하려면 centos 7에서 아래 단계를 따르십시오.
Yum 저장소 설정 먼저 시스템에서 Remi 및 EPEL yum 저장소를 활성화해야 합니다. CentOS 및 Red Hat 7/6 시스템에 EPEL 저장소를 설치하려면 다음 명령을 사용하십시오.
이 명령을 사용하여 시스템에 EPEL yum 저장소를 설치하세요.
sudo yum install epel-release
이제 OS 버전에 따라 다음 명령 중 하나를 실행하여 Remi 저장소를 설치하십시오.
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
CentOS에 PHP 7 설치 시스템은 yum 저장소에서 PHP를 설치할 준비가 되었습니다. 다음 명령 중 하나를 사용하여 요구 사항에 따라 시스템에 PHP 7.4, PHP 7.3, PHP 7.2 또는 PHP 7.1을 설치합니다.
PHP 7.4 설치
yum --enablerepo=remi-php74 install php
PHP 7.3 설치
yum --enablerepo=remi-php73 install php
PHP 7.2 설치
yum --enablerepo=remi-php72 install php
PHP 7.1 설치
yum --enablerepo=remi-php71 install php
내 시스템에 최신 버전의 PHP 7.4를 설치했습니다. 이제 다음 명령을 실행하여 내 시스템에서 현재 활성화된 PHP 버전을 확인하십시오.
php -v
.
PHP 7.4.1 (cli) (built: Dec 17 2019 16:35:58) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
PHP 모듈 설치 애플리케이션 요구 사항에 따라 다른 PHP 모듈을 설치해야 할 수도 있습니다. 다음 명령은 보다 유용한 PHP 모듈 중 일부를 설치합니다.
PHP 7.4의 경우
yum --enablerepo=remi-php74 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
PHP 7.3의 경우
yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
PHP 7.2의 경우
yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
PHP 7.1의 경우
yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt