一:下載php源碼sudo wget cn2.php.net/distributions/php-X.X.X.tar.gzphp
二:解壓 tar xzf /php-X.X.X.tar.gznginx
三:進入源碼ext pgsql或pdo_pgsqlsql
四:whereis phpize 來生成編譯環鏡configure,若是沒有apt-get install php5-dev安裝post
五:sudo apt-get install
postgresql
spa
sudo apt-get install libpq-dev
.net
五:sudo /usr/local/php5.5/bin/phpize 讀取當前php環境postgresql
sudo ./configure --with-php-config=/usr/local/php5.5/bin/php-config 生成配置code
sudo make&& make install
pdo
六:sudo /yjdata/www/change_php_version.sh 5.5get
/usr/local/bin/php-5.5.7/ext/pdo_pgsql
七:phpinfo() 看php.ini在哪裏,開啓pdo_pgsql.so ,註冊.dll和php_
重啓nginx: sudo /usr/local/nginx/sbin/nginx -s reload