1. 下载php5.6.17版本;编译安装,

 

./configure --prefix=/usr/local/php5. --with-config-file-path=/usr/local/php5./etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype --disable-ipv6

#在编译通过后安装; 在编译过程中所需要的扩展需要一一安装上
make && make install

2. 配置php-fpm;

启动脚本:/etc/init.d/php-fpm

#! /bin/sh

### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start:
# Default-Stop:
# Short-Description: starts php-fpm
# Description: starts the PHP FastCGI Process Manager daemon
### END INIT INFO prefix=/usr/local/php5.6 #注意此路径
exec_prefix=${prefix} php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=${prefix}/etc/php-fpm.conf
php_fpm_PID=${prefix}/var/run/php-fpm.pid php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID" wait_for_pid () {
try=
while test $try -lt ; do case "$1" in
'created')
if [ -f "$2" ] ; then
try=''
break
fi
;; 'removed')
if [ ! -f "$2" ] ; then
try=''
break
fi
;;
esac echo -n .
try=`expr $try + `
sleep
done
}
case "$1" in
start)
echo -n "Starting php-fpm " $php_fpm_BIN --daemonize $php_opts if [ "$?" != ] ; then
echo " failed"
exit
fi wait_for_pid created $php_fpm_PID if [ -n "$try" ] ; then
echo " failed"
exit
else
echo " done"
fi
;;
stop)
echo -n "Gracefully shutting down php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit
fi
kill -QUIT `cat $php_fpm_PID`
wait_for_pid removed $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed. Use force-quit"
exit
else
echo " done"
fi
;;
status)
if [ ! -r $php_fpm_PID ] ; then
echo "php-fpm is stopped"
exit
fi PID=`cat $php_fpm_PID`
if ps -p $PID | grep -q $PID; then
echo "php-fpm (pid $PID) is running..."
else
echo "php-fpm dead but pid file exists"
fi
;; force-quit)
echo -n "Terminating php-fpm " if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit
fi kill -TERM `cat $php_fpm_PID` wait_for_pid removed $php_fpm_PID if [ -n "$try" ] ; then
echo " failed"
exit
else
echo " done"
fi
;; restart)
$ stop
$ start
;; reload)
echo -n "Reload service php-fpm " if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit
fi kill -USR2 `cat $php_fpm_PID` echo " done"
;; *)
echo "Usage: $0 {start|stop|force-quit|restart|reload|status}"
exit
;; esac

3. 安装mysql pdo扩展

a.  进入在PHP源码包中进入ext/pdo_mysql

b、配置和编译文件

/usr/local/php5.6/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config –with-pdo-mysql=/usr/local/mysql
make
make install

注: 我的PHP安装在 : /usr/local/php/ mysql 安装在 : /usr/local/mysql 编译的时候注意你自己的安装目录在哪里

c、安装到PHP配置下

  把这个记住,然后打开 php.ini文件,
  并添加一行

  extension=pdo_mysql.so

d、重启php-fpm

/etc/init.d/php-fpm restart

步骤总结:

1. 编译安装php --->配置php-fpm 并启动;若端口被占用则结束其进程  killall php-fpm

2. 安装pdo_mysql的扩展支持或编译php时加上

./configure --with-pdo-mysql --with-mysql-sock=/usr/local/mysql/mysql.sock

3. 重启测试。

centos 6.5 升级php到5.6.17版本的更多相关文章

  1. centos 6.5 升级内核 linux 3.12.17 (笔记 实测)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G) 系统版本:Linux centos 2.6.32-431.el6.x86_64(Centos-6.5-x86_64-mi ...

  2. centos 6.5 升级内核 linux 3.12.17

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G) 系统版本:Linux centos 2.6.32-431.el6.x86_64(Centos-6.5-x86_64-mi ...

  3. CentOS 7.4升级curl和git到最新版本

    升级curl和git到最新版本 [root@jenkins ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel ...

  4. CentOS 6.9升级GCC至7.3.0版本

    1.查看当前centos版本:  cat /etc/redhat-release 2. 安装centos6.9默认的开发工具,包含gcc,g++,make等等一系列工具: yum groupinsta ...

  5. Centos 6.5升级openssl到1.1.0f版本

    wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz ./config --prefix=/usr/local/openssl share ...

  6. CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)

    ---恢复内容开始--- CentOS 6.6 升级GCC G++ (当前最新GCC/G++版本为v6.1.0) 没有便捷方式, yum update....   yum install 或者 添加y ...

  7. CentOS 6.5升级Python和安装IPython

    <转自:http://www.noanylove.com/2014/10/centos-6-5-sheng-ji-python-he-an-zhuang-ipython/>自己常用.以做备 ...

  8. CentOS 6.5升级Python后yum不可用的解决方案

    因开发需要,今天把CentOS 6.5自带的Python2.6.6升级到了Python2.7.3.按照如下步骤进行升级 1.查看当前系统python的版本 python -V 2.下载2.7.3版本的 ...

  9. Centos 6.5升级到Git2.1.2的步骤

    Centos 6.5升级到Git2.1.2的步骤 Centos 6.5升级到Git2.1.2其实是非常的简单,因这款版本控制程序非常的好用,所以小编自己也是使用它了,下面一起来看看Centos 6.5 ...

随机推荐

  1. 'Agent XPs' component is turned off as part of the security configuration for this server

    To turn on Agent XP's by running this script: sp_configure 'show advanced options', 1; Go RECONFIGUR ...

  2. ARGB和PARGB

    原文链接: http://blog.csdn.net/lnwaycool/article/details/8610313 ARGB和PARGB是针对32位图像而言的,Windows下图像可以是1位.4 ...

  3. Redis 的安装与使用(单节点)

    Redis 的安装与使用(单节点)   环境:CentOS 6.5 Redis 版本:redis-3.0 (考虑到Redis3.0 在集群和性能提升方面的特性,rc 版为正式版的候选版,而且 很快就出 ...

  4. Java Nashorn--Part 3

    jjs 的 -Scripting 选项 jjs shell 是一个不错的方法来测试一些基本的 JavaScript,或者于不太熟悉的 JavaScript包进行交互(主要是指 javax.script ...

  5. JetBrains PyCharm专业版激活

    PyCharm最新2018激活码 激活时选择License server 填入 http://idea.imsxm.com 然后点击Active即可 PS:在线激活有一个过期时间,这个时间一过就必须再 ...

  6. Mysql命令行改动字段类型

    在做微信公众平台 知识百科(账号:zhishiwiki) 时,由于字段先前设计的不合理.导致内容装不下,因此须要改动其字段类型为 text 这里使用到了 alter 命令 alter table 表名 ...

  7. C++ error: passing 'const std::map<>]' discards qualifiers或pass-by-reference-to-const-map导致的“discards qualifiers”

    产生问题的场景: int func(const map<int, string> &aMap) { string value = amap[0]; } 或者 int  Test:: ...

  8. Java 8 – Filter a Map examples

    Java 8 – Filter a Map examplesFew Java examples to show you how to filter a Map with Java 8 stream A ...

  9. 更新django到2.x

    django-2.x 已经发布了.想体验一下它的新功能.于是把之前电脑上的django-1.11.7uninstall 掉 一.卸载django-1.11.7: pip3 uninstall djan ...

  10. mysql中的NULL的判断

      mysql> delete from `zhangchao` where x='NULL'; rows affected (0.00 sec) mysql> delete from ` ...