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 :
extension=...
lines to your php.ini
filephp.ini
fileYou 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With