Friday, November 7, 2014

Configure: error: memcache support requires ZLIB

checking for the location of zlib,configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
ERROR: `/tmp/pear/temp/memcache/configure --enable-memcache-session=yes' failed


To remove this error,you need to install zlib package.

If you are using Debian or Ubuntu, Run command

sudo apt-get install zlib1g-dev libncurses5-dev
If you are using CentOS, fedora or RHEL, Run command
sudo yum install zlib-devel
Now run again,

sudo /opt/lampp/bin/pecl install memcache
If it runs successfully

Add line

extension=memcache.so
in the file php.ini.

Restart xampp.

Memcache php extension not loaded

 Memcache php extension not loaded

If you are using XAMPP and you are facing this error while running your web application, Run following command in terminal.
sudo /opt/lampp/bin/pecl install memcache
If you face error: phpize failed
To remove this error, you need to install autoconf package.

If you are using Debian or Ubuntu, Run command
sudo apt-get install autoconf
If you are using CentOS, fedora or RHEL, Run command
sudo yum install autoconf
Now Run:
sudo /opt/lampp/bin/pecl install memcache

If you face error: 
checking for the location of zlib,configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
ERROR: `/tmp/pear/temp/memcache/configure --enable-memcache-session=yes' failed


To remove this error,you need to install zlib package.

If you are using Debian or Ubuntu, Run command

sudo apt-get install zlib1g-dev libncurses5-dev
If you are using CentOS, fedora or RHEL, Run command
sudo yum install zlib-devel
Now run again,

sudo /opt/lampp/bin/pecl install memcache
If it runs successfully

Add line

extension=memcache.so
in the file php.ini.

Restart xampp

Error while restarting xampp - apachectl returned 1.

Error while restarting xampp - apachectl returned 1.

If you are facing this error while restarting XAMPP, the reason may be your virtualhost file. (/opt/lampp//etc/extra/httpd-vhosts.conf)

Check your virtual host file if there is any garbage text in it and Apache is not able to understand it.

Garbage text means half closed tags, copy-paste unnecessary data etc

Check your file closely and make necessary corrections.

Solution II
If you are still facing same problem, open Directory /opt/lampp/logs
and remove the file httpd.pid.
sudo rm -f /opt/lampp/logs/httpd.pid 
Now restart xampp. You should not face this problem again.