简体   繁体   中英

PHP can't use compiled memcache.so extension

I have PHP 5.4.8 compiled from source on Ubuntu 12.04. PHP resides in a custom directory.

I compiled memcache-2.2.7 and I ended up with a memcache.so extension.

I modified my php.ini and added:

extension=/jusr/php5/ext/memcache.so

but when I run a test script on CLI i get an error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/jusr/php5/ext/memcache.so' - /jusr/php5/ext/memcache.so: undefined symbol: executor_globals in Unknown on line 0

What's wrong?

I have actually figured it out. What most "guides" out there won't tell you is that you need to link memcache with the php-config file located in your PHP installation.

cd /home/user/memcache-2.2.7
phpize --clean && phpize
./configure --with-php-config=/path/to/php/bin/php-config
make
make install

That is how you link memcache with PHP. I could not get this ANYWHERE.

(From bugs.php.net)

You've built the library using wrong PHP headers. Please make sure phpize and php-config in your system came with the version of PHP you're using.

https://bugs.php.net/bug.php?id=57263

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM