Upgrade do PHP 5.4 para o PHP 7.4 no CentOS 7
Veirique a versão do seu PHP.
1 |
php -v |
O retorno deve ser: PHP 5.4.16 (cli) (built: Apr 12 2018 19:02:01) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies Instale agora os repositórios REMI e EPEL
1 2 |
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm |
Verifique no arquivo /etc/yum.repos.d/remi.repo se na sessão remi o flag enabled está igual a […]
Upgrade do php 7.2 para 7.3 no CentOS 7
Desabilite o repositório do php 7.2
1 |
yum-config-manager --disable remi-php72 |
Agora habilite o repositório do php 7.3
1 |
yum-config-manager --enable remi-php73 |
Feito isto, basta fazer um update
1 |
yum update |
O PHP será atualizado da versão 7.2 para a versão 7.3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * epel: mirror.uic.edu * remi-php73: mirror.team-cymru.com * remi-safe: mirror.team-cymru.com * webtatic: us-east.repo.webtatic.com remi-php73 | 3.0 kB 00:00:00 remi-php73/primary_db | 201 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-cli.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-cli.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-common.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-common.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-gd.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-gd.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-json.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-json.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-ldap.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-ldap.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-mbstring.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-mbstring.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-mysqlnd.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-mysqlnd.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-pdo.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-pdo.x86_64 0:7.3.9-1.el7.remi will be an update ---> Package php-pecl-mcrypt.x86_64 0:1.0.2-2.el7.remi.7.2 will be updated ---> Package php-pecl-mcrypt.x86_64 0:1.0.2-2.el7.remi.7.3 will be an update ---> Package php-xml.x86_64 0:7.2.22-1.el7.remi will be updated ---> Package php-xml.x86_64 0:7.3.9-1.el7.remi will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================== Package Arch Version Repository Size =============================================================================================== Updating: php x86_64 7.3.9-1.el7.remi remi-php73 3.2 M php-cli x86_64 7.3.9-1.el7.remi remi-php73 4.9 M php-common x86_64 7.3.9-1.el7.remi remi-php73 1.1 M php-gd x86_64 7.3.9-1.el7.remi remi-php73 80 k php-json x86_64 7.3.9-1.el7.remi remi-php73 65 k php-ldap x86_64 7.3.9-1.el7.remi remi-php73 82 k php-mbstring x86_64 7.3.9-1.el7.remi remi-php73 510 k php-mysqlnd x86_64 7.3.9-1.el7.remi remi-php73 233 k php-pdo x86_64 7.3.9-1.el7.remi remi-php73 127 k php-pecl-mcrypt x86_64 1.0.2-2.el7.remi.7.3 remi-php73 29 k php-xml x86_64 7.3.9-1.el7.remi remi-php73 207 k Transaction Summary =============================================================================================== Upgrade 11 Packages Total download size: 11 M Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/11): php-7.3.9-1.el7.remi.x86_64.rpm | 3.2 MB 00:00:00 (2/11): php-cli-7.3.9-1.el7.remi.x86_64.rpm | 4.9 MB 00:00:00 (3/11): php-common-7.3.9-1.el7.remi.x86_64.rpm | 1.1 MB 00:00:00 (4/11): php-gd-7.3.9-1.el7.remi.x86_64.rpm | 80 kB 00:00:00 (5/11): php-json-7.3.9-1.el7.remi.x86_64.rpm | 65 kB 00:00:00 (6/11): php-ldap-7.3.9-1.el7.remi.x86_64.rpm | 82 kB 00:00:00 (7/11): php-mysqlnd-7.3.9-1.el7.remi.x86_64.rpm | 233 kB 00:00:00 (8/11): php-mbstring-7.3.9-1.el7.remi.x86_64.rpm | 510 kB 00:00:00 (9/11): php-pdo-7.3.9-1.el7.remi.x86_64.rpm | 127 kB 00:00:00 (10/11): php-xml-7.3.9-1.el7.remi.x86_64.rpm | 207 kB 00:00:00 (11/11): php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64.rpm | 29 kB 00:00:00 ----------------------------------------------------------------------------------------------- Total 17 MB/s | 11 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : php-json-7.3.9-1.el7.remi.x86_64 1/22 Updating : php-common-7.3.9-1.el7.remi.x86_64 2/22 warning: /etc/php.ini created as /etc/php.ini.rpmnew Updating : php-cli-7.3.9-1.el7.remi.x86_64 3/22 Updating : php-pdo-7.3.9-1.el7.remi.x86_64 4/22 Updating : php-mysqlnd-7.3.9-1.el7.remi.x86_64 5/22 Updating : php-7.3.9-1.el7.remi.x86_64 6/22 Updating : php-xml-7.3.9-1.el7.remi.x86_64 7/22 Updating : php-ldap-7.3.9-1.el7.remi.x86_64 8/22 Updating : php-mbstring-7.3.9-1.el7.remi.x86_64 9/22 Updating : php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 10/22 Updating : php-gd-7.3.9-1.el7.remi.x86_64 11/22 Cleanup : php-7.2.22-1.el7.remi.x86_64 12/22 Cleanup : php-cli-7.2.22-1.el7.remi.x86_64 13/22 Cleanup : php-mysqlnd-7.2.22-1.el7.remi.x86_64 14/22 Cleanup : php-pdo-7.2.22-1.el7.remi.x86_64 15/22 Cleanup : php-gd-7.2.22-1.el7.remi.x86_64 16/22 Cleanup : php-pecl-mcrypt-1.0.2-2.el7.remi.7.2.x86_64 17/22 Cleanup : php-mbstring-7.2.22-1.el7.remi.x86_64 18/22 Cleanup : php-ldap-7.2.22-1.el7.remi.x86_64 19/22 Cleanup : php-xml-7.2.22-1.el7.remi.x86_64 20/22 Cleanup : php-json-7.2.22-1.el7.remi.x86_64 21/22 Cleanup : php-common-7.2.22-1.el7.remi.x86_64 22/22 Verifying : php-xml-7.3.9-1.el7.remi.x86_64 1/22 Verifying : php-ldap-7.3.9-1.el7.remi.x86_64 2/22 Verifying : php-common-7.3.9-1.el7.remi.x86_64 3/22 Verifying : php-cli-7.3.9-1.el7.remi.x86_64 4/22 Verifying : php-mbstring-7.3.9-1.el7.remi.x86_64 5/22 Verifying : php-7.3.9-1.el7.remi.x86_64 6/22 Verifying : php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 7/22 Verifying : php-pdo-7.3.9-1.el7.remi.x86_64 8/22 Verifying : php-json-7.3.9-1.el7.remi.x86_64 9/22 Verifying : php-gd-7.3.9-1.el7.remi.x86_64 10/22 Verifying : php-mysqlnd-7.3.9-1.el7.remi.x86_64 11/22 Verifying : php-gd-7.2.22-1.el7.remi.x86_64 12/22 Verifying : php-cli-7.2.22-1.el7.remi.x86_64 13/22 Verifying : php-pdo-7.2.22-1.el7.remi.x86_64 14/22 Verifying : php-pecl-mcrypt-1.0.2-2.el7.remi.7.2.x86_64 15/22 Verifying : php-common-7.2.22-1.el7.remi.x86_64 16/22 Verifying : php-ldap-7.2.22-1.el7.remi.x86_64 17/22 Verifying : php-xml-7.2.22-1.el7.remi.x86_64 18/22 Verifying : php-7.2.22-1.el7.remi.x86_64 19/22 Verifying : php-mysqlnd-7.2.22-1.el7.remi.x86_64 20/22 Verifying : php-json-7.2.22-1.el7.remi.x86_64 21/22 Verifying : php-mbstring-7.2.22-1.el7.remi.x86_64 22/22 Updated: php.x86_64 0:7.3.9-1.el7.remi php-cli.x86_64 0:7.3.9-1.el7.remi php-common.x86_64 0:7.3.9-1.el7.remi php-gd.x86_64 0:7.3.9-1.el7.remi php-json.x86_64 0:7.3.9-1.el7.remi php-ldap.x86_64 0:7.3.9-1.el7.remi php-mbstring.x86_64 0:7.3.9-1.el7.remi php-mysqlnd.x86_64 0:7.3.9-1.el7.remi php-pdo.x86_64 0:7.3.9-1.el7.remi php-pecl-mcrypt.x86_64 0:1.0.2-2.el7.remi.7.3 php-xml.x86_64 0:7.3.9-1.el7.remi Complete! |
Ao final verifique a versão com o php -v e reinicie o apache para a nova versão ser usada.
Instalando o PHP 7 no CentOS ou Red Hat 7
Instale e ative o repositório EPEL.
1 |
yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
Agora para instalar o repositório webtatic.
1 |
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm |
Agora instale o PHP e alguns módulos básicos.
1 |
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 |
Verifique a instalação rodando o comando:
1 |
php -v |
Para verificar os módulos disponíveis para instalação, rode o comando:
1 |
yum search php70 |