php最新版本的安装,centos安装新PHP版本
方法一:
yum 安裝默認的版本太低了,手動安裝有一些麻煩,想采用Yum安裝的可以使用下面的方案:
1.檢查當前安裝的PHP包
yum?list?installed?|?grep?php
如果有安裝的PHP包,先刪除他們
yum?remove?php.x86_64?php-cli.x86_64?php-common.x86_64?php-gd.x86_64?php-ldap.x86_64?php-mbstring.x86_64?php-mcrypt.x86_64?php-mysql.x86_64?php-pdo.x86_64
2.Centos?5.X???rpm?-Uvh?http://mirror.webtatic.com/yum/el5/latest.rpm
CentOs?6.x??rpm?-Uvh?http://mirror.webtatic.com/yum/el6/latest.rpm
CentOs?7.X????rpm?-Uvh
rpm?-Uvh?https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
如果想刪除上面安裝的包,重新安裝
rpm?-qa?|?grep?webstatic
rpm?-e??上面搜索到的包即可
3.運行yum?install
yum?install?php55w.x86_64?php55w-cli.x86_64?php55w-common.x86_64?php55w-gd.x86_64?php55w-ldap.x86_64?php55w-mbstring.x86_64?php55w-mcrypt.x86_64?php55w-mysql.x86_64?php55w-pdo.x86_64
yum?install?php56w.x86_64?php56w-cli.x86_64?php56w-common.x86_64?php56w-gd.x86_64?php56w-ldap.x86_64?php56w-mbstring.x86_64?php56w-mcrypt.x86_64?php56w-mysql.x86_64?php56w-pdo.x86_64
注:如果想升級到5.6把上面的55w換成56w就可以了。
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
4.安裝PHP?FPM
yum?install?php55w-fpm
yum?install?php56w-fpm
yum?install?php70w-fpm
方法二:
源碼安裝:將之前的源碼安裝的版本備份為其他的名字
mv?/usr/local/php/?/usr/local/php5.3
安裝libiconv
mkdir?-p?/usr/local/setupcd?/usr/local/setup
wget
tar?zxvf?libiconv-1.14.tar.gz
cd?libiconv-1.14
./configure?--prefix=/usr/local/libiconv
make?&&?make?install
cd?..
安裝libmcrypt
wget
tar?zxvf?libmcrypt-2.5.8.tar.gzcd?libmcrypt-2.5.8
./configuremake?&&?make?install
cd?..
安裝mhash
tar?jxvf?mhash-0.9.3.tar.bz2
cd?mhash-0.9.3
./configure
make?&&?make?install
cd?..
安裝mcrypt
wget
tar?zxvf?mcrypt-2.6.8.tar.gzcd?mcrypt-2.6.8
./configuremake?&&?make?install
cd?..
安裝PHP?5.5.5
wget
tar?zxvf?php-5.5.5.tar.gz
cd?php-5.5.5
正式編譯,注意安裝路徑不能與舊版本路徑相同
./configure?--prefix=/usr/local/php?--with-config-file-path=/usr/local/php/etc?--enable-fpm?--with-fpm-user=www?--with-fpm-group=www?--with-mysql=mysqlnd?--with-mysqli=mysqlnd?--with-pdo-mysql=mysqlnd?--with-iconv-dir?--with-freetype-dir?--with-jpeg-dir?--with-png-dir?--with-zlib?--with-libxml-dir=/usr?--enable-xml?--disable-rpath?--enable-magic-quotes?--enable-safe-mode?--enable-bcmath?--enable-shmop?--enable-sysvsem?--enable-inline-optimization?--with-curl?--with-curlwrappers?--enable-mbregex?--enable-mbstring?--with-mcrypt?--enable-ftp?--with-gd?--enable-gd-native-ttf?--with-openssl?--with-mhash?--enable-pcntl?--enable-sockets?--with-xmlrpc?--enable-zip?--enable-soap?--without-pear?--with-gettext?--disable-fileinfo?--enable-maintainer-zts
make?&&?make?install
總結
以上是生活随笔為你收集整理的php最新版本的安装,centos安装新PHP版本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sizeof操作
- 下一篇: Oracle 日常巡检——数据库基本情况