How to upgrade PHP 7.0.0RC1 to the already released version 7.0 in centOS?

4

Good morning,

How do I upgrade PHP 7.0.0RC1 to the already released version 7.0 in centOS?

Thank you

    
asked by anonymous 04.12.2015 / 13:04

2 answers

1

To remove the PHP 7 RC version and install the final version released on December 3 (Version 7.0.0) you will need to perform the following steps:

1 Step: Manually uninstall the folder and contents present in php-7.0.0RC1

cd /opt
sudo rm -rf php-7.0.0RC1

2 Step: Uninstall libphp7.so in the "modules" directory

cd /usr/lib64/httpd/modules/
sudo rm -rf libphp7.so

3 Step: Download PHP 7.0.0 Realased released on December 3rd from the official php-php.net site

sudo wget http://php.net/get/php-7.0.0.tar.bz2/from/this/mirror

4 Step: Extract the files from the downloaded file * tar.bz2 to the / opt directory

tar xzf php-7.0.0RC1.tar.gz -C /opt

Step 5: Once you have done this, in the /opt/php-7.0.0 directory, buildconf -force is executed, doing:

cd /opt/php-7.0.0
ls
./buildconf --force

6 Step: The ./configure command is then executed. Below is the instruction to perform a typical php installation, however for a custom installation you can always see the php manuals in php.net.

    ./configure \
--prefix=$HOME/php7/usr \
--with-config-file-path=$HOME/php7/usr/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-apxs2

Step 7: Once you've done this, you should run these commands:

make

then run:

make install

Step 8: Restart the apache server

sudo /sbin/service httpd restart

Step 9: Done! You can now run phpinfo () to verify that the installation was successful by verifying that the now installed version is 7.0.0.

    
04.12.2015 / 15:53
1

If you have YUM, I recommend the Webtatic repository

Before installing anything, always check that there is no other installation.

  

yum list installed | grep php | cut -d '' -f1

In bold, keyword to search. In this case, we are looking for installations related to PHP.

If necessary, remove what you find. Example:

>yum remove php5-antigo

The name of the package should be exactly the same as the one that appears in the previously searched list.

If you want to remove everything, just do:

>yum remove php5*

After confirming that everything is clean and safe from conflict, we proceed with the installation.

Update the repository:

>rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
>rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install PHP

>yum install php70w

It's done!

To add extensions

>yum install php70w-nome_da_extensão

Example installing PHP-BCMath:

>yum install php70w-bcmath

After completing, check out the console

>php -v

Show version

>php -m

Show extensions loaded

    
04.01.2016 / 16:33