phpize compiles memcache against previous version of PHP
My client performed an upgrade using EasyApache bringing php up to 5.4.29.
Previously, it was running php 5.3.x and we had compiled the memcache extension for it. The upgrade broke the memcache integration so I downloaded it and recompiled it again. However, it appears phpize is pulling the old version of PHP as the extension was compiled into the old extension directory not the new one. See abbreviated output from commands below.
How can I compile memcache with the correct version of php?
root@server1 [/usr/bin]# php -v
PHP 5.4.29 (cgi-fcgi) (built: Jun 25 2014 18:41:45)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
root@server1 [/usr/bin]# grep ^extension_dir /usr/local/lib/php.ini
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525"Previously, it was running php 5.3.x and we had compiled the memcache extension for it. The upgrade broke the memcache integration so I downloaded it and recompiled it again. However, it appears phpize is pulling the old version of PHP as the extension was compiled into the old extension directory not the new one. See abbreviated output from commands below.
root@server1 [~/memcache]# wget http://pecl.php.net/get/memcache-3.0.8.tgz
root@server1 [~/memcache]# tar -zxf memcache-3.0.8.tgz
root@server1 [~/memcache]# cd memcache-3.0.8
root@server1 [~/memcache/memcache-3.0.8]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
root@server1 [~/memcache/memcache-3.0.8]# ./configure
root@server1 [~/memcache/memcache-3.0.8]# make
root@server1 [~/memcache/memcache-3.0.8]# make install
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20090626/How can I compile memcache with the correct version of php?
-
Figured it out. Looks like PHP is installed in two places. I was able to compile the extension properly using the following. root@server1 [~/memcache]# cd memcache-3.0.8 root@server1 [~/memcache/memcache-3.0.8]# /usr/local/bin/phpize root@server1 [~/memcache/memcache-3.0.8]# ./configure --with-php-config=/usr/local/bin/php-config root@server1 [~/memcache/memcache-3.0.8]# make root@server1 [~/memcache/memcache-3.0.8]# make install Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20100525/ 0 -
Restarted Apache, but still no dice. PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match in Unknown on line 0 0 -
Hello :) Have you tried installing it through PECL? EX: pecl install memcache
Note that you may want to uninstall any existing implementations of memcache that you manually installed before running the above command. Thank you.0
Please sign in to leave a comment.
Comments
3 comments