PHP doesn't load extensions specified in php.ini, but loads with dl()
Php doesn't load extensions specified through php.ini
php -v
doesn't give any errors or warnings
php -i | grep extension_dir
shows that extension_dir is set to where extension files are, but they don't show up in extension list in php -m
However running php -r 'dl("apc.so"); phpinfo();' | grep apc
shows that modules load normaly with dl()
function.
I installed php-5.3.5 from source. Configured with
'--enable-fastcgi'
'--enable-fpm'
'--enable-mbstring'
'--enable-pdo'
'--enable-inline-optimization'
'--enable-sockets'
'--enable-zip'
'--enable-mbregex开发者_高级运维'
'--enable-xml'
'--enable-sysvsem'
'--enable-sysvshm'
'--enable-pcntl'
'--enable-ftp'
'--enable-soap'
'--enable-shmop'
'--disable-rpath'
'--disable-debug'
'--with-mcrypt'
'--with-zlib'
'--with-curl'
'--with-bz2'
'--with-mysql'
'--with-gettext'
'--with-gd'
'--with-pdo-mysql'
'--with-pcre-regex'
'--with-mhash'
'--with-pic'
'--with-zlib-dir'
'--with-ttf'
'--with-openssl'
'--with-png-dir'
'--with-libdir=lib64'
'--without-pdo-sqlite'
'--without-sqlite'
uname -a
prints:
Linux ip-*-*-*-* 2.6.34.7-56.40.amzn1.x86_64 #1 SMP Fri Oct 22 18:48:49 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
Php runs on nginx 0.9.5 through php-fpm
For extensions to be loaded, you must have one line such as the following one :
extension=apc.so
in the php.ini
(or any other .ini
file) file that's used by PHP.
If extensions load properly when you're using dl()
, it means your extensions are OK (no wrong version or anything like that).
The next step, so is to :
- Make sure you have added the
extension=...
lines to yourphp.ini
file - Make sure you've modified the right
php.ini
file
You can check which php.ini
file is used : it's displayed in the ouput of phpinfo()
.
Note : with some Linux distributions, the php.ini
file used in CLI is not the same one as the one used with Apache (not sure about the one used for nginx).
Sort-of fixed this by statically linking extensions I needed in the php executable, everything works now. Server won't load xdebug extension though.
Go to Php.ini File from phpmyadmin open in text editor and search for ;extension=php_soap.dll and just remove ; symbol and after that restart your Wamp/xamp services and then refresh your url page..enjoy
精彩评论