./configure --prefix=/usr/local/php5.6 --with-config-file-path=/usr/local/php5.6/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: 234
5# default-stop: 016
# short-description: starts php-fpm
# description: starts the php fastcgi process manager daemon
### end init info
prefix
=/usr/local/php5.6 #注意此路徑
exec_prefix=$
php_fpm_bin=$/sbin/php-fpm
php_fpm_conf=$/etc/php-fpm.conf
php_fpm_pid=$/var/run/php-fpm.pid
php_opts="
--fpm-config $php_fpm_conf --pid $php_fpm_pid
"wait_for_pid ()
case"$1
"instart)
echo -n "
starting php-fpm
"$php_fpm_bin --daemonize $php_opts
if [ "
$?" != 0 ] ; then
echo
"failed
"exit 1fi
wait_for_pid created $php_fpm_pid
if [ -n "
$try
" ] ; then
echo
"failed
"exit
1else
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 1fi
kill -quit `cat
$php_fpm_pid`
wait_for_pid removed $php_fpm_pid
if [ -n "
$try
" ] ; then
echo
"failed. use force-quit
"exit
1else
echo
"done"fi
;; status)
if [ ! -r $php_fpm_pid ] ; then
echo
"php-fpm is stopped
"exit 0fi
pid=`cat
$php_fpm_pid`
ifps -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 1fi
kill -term `cat
$php_fpm_pid`
wait_for_pid removed $php_fpm_pid
if [ -n "
$try
" ] ; then
echo
"failed
"exit
1else
echo
"done"fi
;; restart)
$0stop
$0start
;;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 1fi
kill -usr2 `cat
$php_fpm_pid`
echo
"done";;
*)echo
"usage: $0
"exit 1;;
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. 重啟測試。
centOS6 5公升級核心
系統核心是2.6,這肯定不行啊.鬱悶的放棄了.第二天感覺不行,還得弄一下,於是發現可以公升級核心.經過各種嘗試核心順利公升級成功.具體步驟如下 1.匯入key rpm import 如果報ssl錯誤,則需要更新網路安全服務 yum update nss 2.安裝elrepo的yum源 到該 找到最新...
CentOS6 5公升級git版本
1.執行如下命令檢視git版本 git version結果如下 git version 1.7.1從git的官方 上可以看到,目前git的最新版本已經到了2.11,我們機器上的git版本太低 2.配置163網路yum源 參考下面的文章進行配置即可 centos配置163yum源 vim git re...
CentOS 6 5 公升級核心到 3 10 28
本文適用於centos 6.4,centos 6.5,親測可行,估計也適用於其他linux發行版。linux核心版本有兩種 穩定版和開發版 linux核心版本號由3個數字組成 r.x.y 去 首頁,可以看到有stable,longterm等版本,longterm是比stable更穩定的版本,會長時間...