Using PHP 7: Difference between revisions

From MiRTA PBX documentation
Jump to navigation Jump to search
No edit summary
No edit summary
Line 35: Line 35:


Edit /etc/opt/remi/php72/php.ini to include the ioncube loader
Edit /etc/opt/remi/php72/php.ini to include the ioncube loader
If you want to try php 7.3
<pre>
yum -y replace php-common --replace-with=php73-php-common
yum -y install php73-php-cli
yum -y install php73-php-pecl-http php73-php-pecl-http-devel
yum -y install php73-php-pecl-mysql php73-php
yum -y install php73-php-pecl-raphf php73-php-pear php55-php-ldap php73-php-cli php73-php-mysqlnd php73-php-xml
yum -y install php73-php-pecl-mysql php73-php-pecl-http-devel php73-php-mbstring  php73-php-process  php73-php-pecl-http  php73-php-json php73-php-pdo
yum -y remove "php55w*"
mv /etc/php.ini.rpmsave /etc/php.ini
mv /etc/opt/remi/php73/php.ini /etc/opt/remi/php73/php.ini.old
ln -s /etc/php.ini /etc/opt/remi/php73/php.ini
service httpd restart
cp /usr/local/src/ioncube/ioncube_loader_lin_7.3.so /usr/lib64/php/modules
\rm /usr/bin/php
ln -s  /usr/bin/php73 /usr/bin/php
</pre>

Revision as of 18:26, 6 July 2021

PHP 7 usage is still experimental...

Upgrade you PHP to php 7.2 by running:


On CentOS 6

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm

On CentOS 7

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm

Then

yum -y replace php-common --replace-with=php72-php-common
yum -y install php72-php-cli
yum -y install php72-php-pecl-http php72-php-pecl-http-devel
yum -y install php72-php-pecl-mysql php72-php
yum -y install php72-php-pecl-raphf php72-php-pear php55-php-ldap php72-php-cli php72-php-mysqlnd php72-php-xml
yum -y install php72-php-pecl-mysql php72-php-pecl-http-devel php72-php-mbstring  php72-php-process  php72-php-pecl-http  php72-php-json php72-php-pdo
yum -y remove "php55w*"
mv /etc/php.ini.rpmsave /etc/php.ini
mv /etc/opt/remi/php72/php.ini /etc/opt/remi/php72/php.ini.old
ln -s /etc/php.ini /etc/opt/remi/php72/php.ini
service httpd restart
cp /usr/local/src/ioncube/ioncube_loader_lin_7.2.so /usr/lib64/php/modules
\rm /usr/bin/php
ln -s  /usr/bin/php72 /usr/bin/php

Edit /etc/opt/remi/php72/php.ini to include the ioncube loader

If you want to try php 7.3

yum -y replace php-common --replace-with=php73-php-common
yum -y install php73-php-cli
yum -y install php73-php-pecl-http php73-php-pecl-http-devel
yum -y install php73-php-pecl-mysql php73-php
yum -y install php73-php-pecl-raphf php73-php-pear php55-php-ldap php73-php-cli php73-php-mysqlnd php73-php-xml
yum -y install php73-php-pecl-mysql php73-php-pecl-http-devel php73-php-mbstring  php73-php-process  php73-php-pecl-http  php73-php-json php73-php-pdo
yum -y remove "php55w*"
mv /etc/php.ini.rpmsave /etc/php.ini
mv /etc/opt/remi/php73/php.ini /etc/opt/remi/php73/php.ini.old
ln -s /etc/php.ini /etc/opt/remi/php73/php.ini
service httpd restart
cp /usr/local/src/ioncube/ioncube_loader_lin_7.3.so /usr/lib64/php/modules
\rm /usr/bin/php
ln -s  /usr/bin/php73 /usr/bin/php