Problems encountered when compiling php-memcached extensions unable to find memcached.h

Source: Internet
Author: User
Tags memcached

This problem has been encountered before, remember the last is to download the source package to specify the path, and today the new installation environment results must try, because I know that as long as the installation of this Libmemcached-devdev package must have a header file, the results finally through the query data really let me find, This procedure is documented below

Install dependencies first to compile the installation

sudo apt-get install libmemcached libmemcached-dev
pecl download memcached
tar zxvf memcached.tar.gz
CD memcached
phpize
./configure--with-libmemcached-dir= This directory can use the following command to find

Dpkg-l Libmemcached-dev | grep memcached.h

/USR/INCLUDE/LIBMEMCACHED-1.0/MEMCACHED.HPP
/usr/include/libmemcached-1.0/struct/memcached.h
/usr/ Include/libmemcached-1.0/memcached.h
/usr/include/libmemcached/memcached.hpp
/usr/include/libmemcached /memcached.h

So obviously saw the Memcached.h file, then the path is written/usr/include/libmemcached but not, guaranteed wrong

./configure--with-libmemcached-dir=/usr/include/libmemcached

checking for libmemcached location ... configure: Error:unable to find Memcached.h under/u/weiz/libmemcached-1.0.16

By viewing
https://github.com/php-memcached-dev/php-memcached/blob/master/config.m4#L277
Can see
if test! -F "$PHP _libmemcached_dir/include/libmemcached/memcached.h";
It turned out that he was going to this path include/libmemcached/under Look, no wonder wrong

Next Execute

sudo mkdir-p/usr/lib/x86_64-linux-gnu/include/libmemcached
sudo ln-s/usr/include/libmemcached/memcached.h/ Usr/lib/x86_64-linux-gnu/include/libmemcached/memcached.h

Then it's done.

sudo./configure--with-php-config=/usr/local/php/bin/php-config--enable-memcached--with-libmemcached-dir=/usr/ Lib/x86_64-linux-gnu--DISABLE-MEMCACHED-SASL

sudo make
sudo make install

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.