PostgreSQL的PDO驱动程序安装php5.4

问题描述:

我有麻烦的Apache2编译php5.4与postgre PDO驱动程序之后开始,我的错误是:PostgreSQL的PDO驱动程序安装php5.4

httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: pdo_pgsql_module_entry 

我的配置选项分别为: PHP配置选项:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-pgsql=/usr/bin/pg_config --with-pgsql=/usr/bin/pg_configure 

Apache2的配置选项

./configure --enable-so --enable-mods-shared=/usr/local/apache2/modules/libphp5.so 

一切W¯¯因为在我将pgsql标志添加到php配置文件之前,先运行良好,然后重新构建。有任何想法吗?

编辑: PHP似乎已经正确安装,它只是让apache的开始:

$>php -i | grep -i pdo 
Configure Command => './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pdo-pgsql=/usr/bin/pg_config' '--with-pgsql=/usr/bin/pg_configure' 
PHP Warning: Unknown: It is not safe to rely on the systems timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0 
PDO 
PDO support => enabled 
PDO drivers => pgsql, sqlite 
pdo_pgsql 
PDO Driver for PostgreSQL => enabled 
Revision => $Id: pdo_pgsql.c 314376 2011-08-06 14:47:44Z felipe $ 
pdo_sqlite 
PDO Driver for SQLite 3.x => enabled 

编辑2: 这里的线53 +对方的我在httpd.conf

LoadModule php5_module  modules/libphp5.so 

<FilesMatch \.php$> 
    SetHandler application/x-httpd-php 
</FilesMatch> 

编辑
+1

/usr/local/apache2/conf/httpd.conf的第53行看起来像什么? – deceze

+0

任何理由为什么它是pg_config和pg_configure?当你重新构建PHP时,你做了“干净”吗?根据我的经验,有时需要这样做,具体取决于哪些选项已更改。 – Matthew

+0

@decese:我在我的文章中添加了相关的行,第53行是LoadModule行。 –

某些选项重建PHP的时候,特别是调整一些依赖于其他组件时(需要make clean例如,将PDO驱动程序添加到已具有核心PDO驱动程序的安装中)。一个缺失的符号就是这个标志。