sh 使用gd,mcrypt,mysql,pdo,apcu,opcache,bz2,zlib,ftp,pecl-geoip,imagemagick在CentOS上将PHP升级到5.6

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 使用gd,mcrypt,mysql,pdo,apcu,opcache,bz2,zlib,ftp,pecl-geoip,imagemagick在CentOS上将PHP升级到5.6相关的知识,希望对你有一定的参考价值。

cat /etc/centos-release # nice to know what CentOS we're running

yum update # update yum (don't upgrade as it will remove essential stuff for our specific server)

yum remove php-common # remove php-common

yum clean all # clean up yum

yum install wget # if wget isn't on the system, install it

# setup a temporary downloads folder
mkdir /temp 
cd /temp

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm

# enable both [remi] and [remi-php56] sections (essentially make them have enabled=1)
nano /etc/yum.repos.d/remi.repo 

# now install new php version
yum install --skip-broken -y gcc php56w php56w-bcmath php56w-cli php56w-common php56w-devel php56w-fpm php56w-gd php56w-ldap php56w-mbstring php56w-mcrypt php56w-mysql php56w-odbc php56w-pdo php56w-bz2 php56w-xml php56w-posix php56w-pcre php56w-zlib php56w-ftp php56w-tokenizer php56w-pear php56w-pecl-apcu php56w-pecl-apcu-devel php56w-pecl-geoip php56w-pecl-igbinary php-pear php-pecl-zendopcache ImageMagick ImageMagick-devel
pecl install imagick

# on our install, we have separate php initializations
# create the file and edd the following
cat > /etc/php.d/20-imagick.ini
; Enable imagemagick extension module
extension=imagick.so

# restart and test
apachectl restart

# remove temporary downloaded rpm repo files as they are cached here now: /var/cache/yum/x86_64/7/
rm -rfv /temp 

以上是关于sh 使用gd,mcrypt,mysql,pdo,apcu,opcache,bz2,zlib,ftp,pecl-geoip,imagemagick在CentOS上将PHP升级到5.6的主要内容,如果未能解决你的问题,请参考以下文章

php7安装

Ubuntu编译PHP7问题

夺命雷公狗---linux NO:43 linux下编译apache整合php

centos6-7 yum安装php的方法

升级php7一些需要注意的地方

centos6-7 yum安装php的方法