php - PECL install with --configureoptions not working - Memcache
Get the solution ↓↓↓Lately, I have been trying to install thepecl memcache
PHP extension on OSX Catalina withbrew memcached
installed and I'm getting the following error every time I try the install process:
configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
I have tried withpecl install memcache
and withpecl install --configureoptions='with-zlib-dir="path"' memcache
to no avail. It always gets the same point and it fails.
From what I have reviewed on different topics regarding the installation of the package the issue seems to be with the-D
option in thepecl install
command, because when I do a manual install from the source code passing the argument--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
to the./configure
command it works like a charm and installs the package but is now not listed inpecl list
installed packages and as so it cannot be uninstalled.
The issue is I needpecl
to manage the installation of the package to be able to uninstall it any time when the environment changes from project to protect.
Answer
Solution:
A quick fix for this (found via https://bugs.php.net/bug.php?id=56522) is to use the PHP_ZLIB_DIR variable instead of --with-zlib-dir.
i.e.PHP_ZLIB_DIR=/usr/local/Cellar/zlib/1.2.11 pecl install memcache
I've struggled with the -D option before as well - near as I can tell it's completely broken.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: can't write image data to path
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.