Jump to content

php not reading/loading extension


Recommended Posts

I have a PHP extension (memcached) that I cannot get to load.

 

In php_info(), I see this:

Configuration File (php.ini) Path File (php.ini) Path: /usr/lib

 

I have edited /usr/lib/php.ini and added the following line:

extension=memcached.so

 

My extension_dir (from php_info()) is:

/usr/lib/php/extensions/no-debug-non-zts-20060613

 

and when I execute:

ls -l /usr/lib/php/extensions/no-debug-non-zts-20060613

 

I can see this line:

-rwxr-xr-x 1 root root 127313 Apr  8 05:14 memcached.so*

 

So, it appears that I have the right directive in php.ini, in the proper php.ini, and the extension is in the proper extensions directory, with a permission level that should let it be run (it's the same as the other modules in the directory), yet I cannot get memcached to show up on php_info() whatsoever. I'm new to installing extensions, so I have no idea why it's not working. I've restarted the server (using apachectl -k restart) but that doesn't help.

 

Any ideas?

Link to comment
Share on other sites

I think it should be

 

extension = "memcached.so"

 

but if you are not getting start-up errors that its obviously fine the way you have it.

 

Everything looks right as you say, does the -k you pass to apache2ctl mean graceful reload ? if so you need to not do that.

 

I usually call the init.d script directly to restart

 

/etc/init.d/apache2 restart

 

although if you are restarting the server then it should be fine.

 

If you try somethign from the command line like

 

php phpinfo.php

 

where phpinfo.php is just a file that does phpinfo()

 

you might get an explanation as to why its not loading.

Link to comment
Share on other sites

Thanks for the thoughts - I have tried writing the extension with quotes, but it didn't work, and none of the other extensions (that actually work) are written with quotes.

 

I've got php_info() on the server, but it has no reference to memcached one way or another.

 

Thanks for the thoughts though.

Link to comment
Share on other sites

  • 2 weeks later...

Interesting. I've found that I can enable the extension by adding the directive to my local php.ini for the site, but the directive added to the master php.ini (location confirmed in phpinfo()) doesn't work.

 

Strange.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.