5

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

1
  • 1
    The nginx restart scripts are not trustworthy. Kill the server, then restart. Commented Mar 20, 2011 at 13:05

3 Answers 3

7

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 your php.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).

Sign up to request clarification or add additional context in comments.

1 Comment

php.ini was configured properly. I also scanned the system for other php.ini files, but that was the only one.
0

Sort-of fixed this by statically linking extensions I needed in the php executable, everything works now. Server won't load xdebug extension though.

1 Comment

I have the same problem, my server does not load xdebug
-1

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

2 Comments

With this module you get all the benefits of phpMyAdmin tool: Import and export data (CSV, SQL) Browse and manage DB tables, views, fields, indexes Execute SQL-queries Search in DB And much more… All the functionality is provided directly from the back-end of your Magento, with simple installation in minutes and is free of charge!
i know what phpmyadmin is. but what does it have to do with the OP's question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.