|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2006-05-15 15:24 UTC] duck at obala dot net
 Description: ------------ zlib detection fails on pecl or manual install in verison 2.0.3 Reproduce code: --------------- /tmp/tmp5W9yT9/memcache-2.0.3/configure: line 1376: syntax error near unexpected token `elif' 'tmp/tmp5W9yT9/memcache-2.0.3/configure: line 1376: ` elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 12:00:01 2025 UTC | 
zlib path: /usr/include/zlib.h versions: GNU bash, version 3.1.17(1)-release (i686-pc-linux-gnu) aclocal (GNU automake) 1.9.6 autoconf (GNU Autoconf) 2.59 code: if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" else { echo "configure: error: Can't find ZLIB headers under "$PHP_ZLIB_DIR"" 1>&2; exit 1; } fi else for i in /usr/local /usr; do if test -f "$i/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include/zlib" elif test -f "$i/include/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include" fi done fiI cannot reproduce it neither on Redhat nor on Suse. There is absolutely nothing special and there are tons of "elif" in other .m4 files all around PHP sources, so I honestly do not see a reason for such code to fail except for your misconfiguration. Please create a shell script like this: #!/bin/sh if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" fi And try to execute it.