【问题标题】:Installing php5.4 with postgresql pdo drivers使用 postgresql pdo 驱动程序安装 php5.4
【发布时间】:2011-10-31 21:02:49
【问题描述】:

在使用 postgre pdo 驱动程序编译 php5.4 后,我无法启动 Apache2,我的错误是:

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

起初一切都运行良好,然后我将 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>

【问题讨论】:

  • /usr/local/apache2/conf/httpd.conf 的第 53 行是什么样的?
  • 为什么是 pg_config 和 pg_configure?你在重建 PHP 的时候做了make clean 吗?根据我的经验,有时有必要这样做,具体取决于哪些选项发生了变化。
  • @decese:我在帖子中添加了相关行,第 53 行是 LoadModule 行。
  • @Matthew:我会尝试make clean 并报告。
  • @Matthew: make clean 成功了,你能把它添加为答案让我接受吗?

标签: php apache apache2


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2010-09-08
    • 1970-01-01
    • 2021-11-21
    • 2012-12-01
    • 1970-01-01
    • 2016-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多