VPS侦探论坛

 找回密码
 注册
查看: 9813|回复: 10

lnmp0.5 如何让php支持 postgresql数据库?

[复制链接]
发表于 2010-12-17 14:58:19 | 显示全部楼层 |阅读模式

pgsql是通过yum安装的 版本号为8.4.4

我把PHP编译部分改为
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-pgsql=/var/lib/pgsql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --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 --with-mime-magic --enable-suhosin

重新编译...但是 用探针查看,还是没有支持

求教....
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-17 15:03:18 | 显示全部楼层

回复 1# 的帖子



已经yum安装了postgresql,在编译参数上加上--with-pgsql ,重新按脚本安装php,重启一下就可以了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-17 16:41:02 | 显示全部楼层

是将 下面的
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-pgsql=/var/lib/pgsql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --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 --with-mime-magic --enable-suhosin

--with-pgsql=/var/lib/pgsql  改为 --with-pgsql 就可以么?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-17 17:06:37 | 显示全部楼层



嗯,再重新按脚本安装php,重启一下就可以了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-17 17:08:43 | 显示全部楼层

已编译模块检测
date  libxml  openssl  pcre  zlib  bcmath  ctype  curl  dom  filter  ftp  gd  
gettext  hash  iconv  json  mbstring  mcrypt  mhash  mime_magic  mysql  SimpleXML  pcntl  SPL  
PDO  pdo_sqlite  posix  Reflection  session  shmop  mysqli  soap  sockets  SQLite  standard  sysvsem  
tokenizer  xml  xmlreader  xmlrpc  xmlwriter  zip  cgi-fcgi  memcache  pdo_mysql  Zend Optimizer

仍然没有....

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-pgsql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --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 --with-mime-magic --enable-suhosin

军哥运维代购:http://shop63846532.taobao.com/

发表于 2010-12-17 20:09:59 | 显示全部楼层

回复 5# 的帖子


编译参数上加上--with-pgsql ,按脚本重新安装php,重启一下就可以了。
你肯定没重新安装,只configure了一下
 楼主| 发表于 2010-12-20 10:00:46 | 显示全部楼层

问题找到了,但是不知道怎么解决
configure 时 报错
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-12-20 10:10:38 | 显示全部楼层

找到解决办法
yum install postgresql-devel postgresql-libs postgresql-contrib

但是 make 时报错
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2010-12-20 10:11:24 | 显示全部楼层

回复 7# 的帖子


--with-pgsql=加上pgsql的路径
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-12-20 10:13:15 | 显示全部楼层



make ZEND_EXTRA_LIBS='-liconv' 时报错

make: *** [sapi/cgi/fastcgi.lo] Error 1
 楼主| 发表于 2010-12-20 10:15:08 | 显示全部楼层

加上了

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --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 --with-mime-magic --enable-suhosin --with-pgsql=/var/lib/pgsql
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 07:54 , Processed in 0.029098 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表