我在php 5.4.x上安装了opensuse 12.2,pdo和pdo_pgsql在apache下工作得很好,但它不适用于内部服务器$ php -S localhost:8080
$ php -m
[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
gd
hash
iconv
interbase
json
libxml
mbstring
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zlib
[Zend Modules]
$ php --ini
Configuration File (php.ini) Path: /etc/php
Loaded Configuration File: /etc/php/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
我在php.ini
中添加以下两行extension=pgsql.so
extension=pdo_pgsql.so
然后我得到:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/extensions/pgsql.so' - /usr/lib64/php/extensions/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/extensions/pdo_pgsql.so' - /usr/lib64/php/extensions/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
但我确信pgsql.so和pdo_pgsql.so都位于/ usr / lib64 / php / extensions /
下答案 0 :(得分:1)
您应该通过网页运行php_info();
,以便查看您的网络服务器正在使用的配置。将其与CLI配置进行比较。
此外,您应该检查/usr/lib64/php/extensions
。