How to update PHP 7.0. 0RC1 to the already released version 7.0 on centOS?
Good Morning,
How do I update PHP 7.0. 0RC1 to the already released version 7.0 on centOS?
Thank you
2 answers
To delete 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 present folder and contents in php-7.0.0RC1
cd /opt
sudo rm -rf php-7.0.0RC1
2 Step: uninstall the libphp7.so present in the directory "modules"
cd /usr/lib64/httpd/modules/
sudo rm -rf libphp7.so
3 Step: download PHP 7.0.0 realased released on December 3rd from the page official php - php.net
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 directory / opt
tar xzf php-7.0.0RC1.tar.gz -C /opt
5 Step: once this is done, 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 command is then executed ./ configure. Below is the instruction to perform a typical php installation, however for a custom installation you can always see the php manuals, em 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
7 Step: once this is done, they must execute these commands:
make
Then run:
make install
8 Step: restart the apache server
sudo /sbin/service httpd restart
9 Step: Done! Can now run the phpinfo() to check if the installation was successful, check if the version now installed is 7.0.0.
If I have YUM, I recommend the repository Webtatic
Before installing anything, always make sure there are no other installations.
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 package name must be exactly the same as what appears in the list of the previously performed search.
If you want to remove everything, just do:
>yum remove php5*
After confirming that everything is clean and without risk of conflicts, we proceed with the installation.
Updates 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 complete, check in console
>php -v
Will show version
>php -m
Will show the loaded extensions