PHP Pecl Memcached module installation problems
I am using on several projects memcached and on the application side the php memcached module. This can be installed as any pear/pecl module, or from source by downloading the source .tgz and running the classic phpize; ./configure; make; make install; While trying to upgrade the memcached module to the latest version available 2.1.2 I encoutered a problem, receiving an error during the compile step:
“configure: error: Cannot find php_session.h”
I am not sure if this error appears on different Linux distributions, but this happened for me on Debian Etch systems, running PHP4 but also with PHP5. Even if there is a pecl bug regarding this problem there is no patch or solution for it. Anyway… if you want to compile this version on Debian the solution is simple, and you will have to create a link from /usr/include/php{4/5} to /usr/include/php:
ln -s /usr/include/php4 /usr/include/php
or if you are running PHP5:
ln -s /usr/include/php5 /usr/include/php
This will allow the configure script to properly find the php_session.h include.
And in the end here is also the list of commands required to compile this module from source (don’t forget to create the link from above for your PHP version):
wget http://pecl.php.net/get/memcache-2.1.2.tgz
tar xvfz memcache-2.1.2.tgz
cd memcache-2.1.2
phpize
./configure
make
make install
or you can also use pear/pecl to install the module:
pecl install memcache
Note: in order to use the phpize command you need on to have installed the php development packages (on Debian the packages needed are php4-dev or php5-dev if you are using php5).
Once you installed the module you will need to enable it in php.ini, by adding:
extension=memcache.so
Tags: memcached, php_extensions, php_modules
Share This







11th July 2007, 22:10
In my case I had a /usr/local/php folder with 2 symlinks inside so I did:
rm /usr/local/php/php4
rm /usr/local/php/php5
rmdir /usr/local/php
ln -s /usr/include/php5 /usr/include/php
Then ./configure worked.
6th August 2007, 16:04
Hy
Sorry for my bad english. I need help i try to use it with php5 and apache2 on debian etch… but i have this error when apache try to load it :
Cannot load /usr/lib/php5/20060613+lfs/memcache.so into server: /usr/lib/php5/20060613+lfs/memcache.so: undefined symbol: executor_globals
Please help me. I’m desperate
6th August 2007, 16:25
weggpod: No idea. On a quick look executor_globals comes from Zendengine… Do you have other ‘non standard’ modules installed (like ionCube, etc.)? If so try disabling them and see if you get the same.
9th August 2007, 09:16
I installed memcache as so in Fedora but how can I test it?
17th September 2007, 20:32
[...] ps. if you are looking how to build the php memcache module you can find more information about that on my older post… [...]
1st October 2007, 03:47
I modified the block that looks for php_session.h to use the defined PREFIX as it didn’t seem to be doing so. I couldn’t otherwise seem to get it to figure out that I had Apache and PHP installed under /users/services/apache/.
if test -f “${prefix}/include/php/ext/session/php_session.h”; then
session_inc_path=”${prefix}/include/php”
elif test -f “$abs_srcdir/include/php/ext/session/php_session.h”; then
session_inc_path=”$abs_srcdir/include/php”
elif test -f “$abs_srcdir/ext/session/php_session.h”; then
session_inc_path=”$abs_srcdir”
elif test -f “$phpincludedir/ext/session/php_session.h”; then
session_inc_path=”$phpincludedir”
fi
10th October 2007, 21:58
I had Zend installed, and ran into this same problem on RHEL.
I ended up just commenting out the if test lines and setting: session_inc_path=â€/usr/include/phpâ€
Which is where my php_session.h was.