php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58409 pecl_http make fails with curl-related compile errors.
Submitted: 2008-11-10 04:54 UTC Modified: 2008-11-18 05:16 UTC
From: Sam dot Sexton at thomsonreuters dot com Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.2.5 OS: Solaris 10
Private report: No CVE-ID: None
 [2008-11-10 04:54 UTC] Sam dot Sexton at thomsonreuters dot com
Description:
------------
First thing is to say that I'm using PHP 5.2.6, but it's not in the drop-down box above.

I am installing pecl_http 1.16.1 behind a firewall, so I'm using phpize and then configure/make. Using three versions of curl (1.18.2, 1.19.0 and 1.19.1), I get errors like those shown below from make. I've recreated the pecl_http directory from the gzip each time. phpize had some warnings, but rc=0 so I thought it was OK to continue. Output included below.


Reproduce code:
---------------
# cd /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1
# phpize
# make


Expected result:
----------------
Successful completion of make! ;-)


Actual result:
--------------
==== phpize ====
[2416](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1973: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1993: AC_CACHE_CHECK is expanded from...
aclocal.m4:3526: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5464: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5463: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2943: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2923: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2886: AC_PROG_LIBTOOL is expanded from...
configure.in:77: the top level
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3481: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7591: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5577: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5576: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4612: _LT_AC_TAGCONFIG is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1973: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1993: AC_CACHE_CHECK is expanded from...
aclocal.m4:3526: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5464: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5463: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2943: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2923: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2886: AC_PROG_LIBTOOL is expanded from...
configure.in:77: the top level
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3481: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7591: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5577: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5576: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4612: _LT_AC_TAGCONFIG is expanded from...
[2417](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: echo $?
0
[2418](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: 

==== make ====

 gcc -I. -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1
-DPHP_ATOM_INC
-I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/include
-I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/main
-I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1
-I/usr/local/include/php -I/usr/local/include/php/main
-I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend
-I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
-I/usr/local/include -I/usr/local/include/php/ext/hash -DHAVE_CONFIG_H
-g -O2 -c /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c 
-fPIC -DPIC -o .libs/http.o
In file included from
/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/php_http.h:58,
                 from
/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c:20:
/usr/local/include/curl/curl.h:1743: error: expected identifier or '('
before string constant
/usr/local/include/curl/curl.h:1754: error: expected identifier or '('
before string constant
In file included from /usr/local/include/curl/curl.h:1783,
                 from
/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/php_http.h:58,
                 from
/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c:20:
/usr/local/include/curl/multi.h:208: error: expected identifier or '('
before string constant
make: *** [http.lo] Error 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-10 09:32 UTC] mike@php.net
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

You're missing the configure step:

$ phpize
$ ./configure [--with-bla... try ./configure --help]
$ make
$ sudo make install
 [2008-11-17 09:26 UTC] Sam dot Sexton at thomsonreuters dot com
Sorry, but I need to re-open this. I took the problem to curl-and-php@cool.haxx.se and also did some more digging. 
 
 Firstly, I didn't forget to run configure (although I did forget to include it in the reproduction code), but hadn't included the output from it as it looked clean, but I can do so if necessary. 
 
 Daniel.haxx.se said "Well, the problem is not in libcurl so I'm at loss here. The build problems you see are within/caused by pecl-http so there's where you should seek your answers." So, that's why I'm back here. 
 
 The starting point is that I ran phpize and ./configure (no args), then make. If you need the output 
 The extra digging I did with a colleague was to run versions of the compile separately with and without -E, to see what the pre-processor produced, as the syntax error message indicated the presence of a quoted string - and that is what the pre-processor produced.
 
 Here are the two test scripts:
 
 [2684](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: more /tmp/foo*
 ::::::::::::::
 /tmp/foo
 ::::::::::::::
  /usr/avt/gcc-3.4.6/bin/gcc -E -I. -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1 -DPHP_ATOM_INC -I/reu
 ters/radt/local/MediaWiki_build/pecl_http-1.6.1/include -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/
 main -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1 -I/usr/local/include/php -I/usr/local/include/php/m
 ain -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/incl
 ude/php/ext/date/lib -I/usr/local/include -I/usr/local/include/php/ext/hash -DHAVE_CONFIG_H -g -O2 -c /reuters
 /radt/local/MediaWiki_build/pecl_http-1.6.1/http.c -fPIC -DPIC -o .libs/http.o 
 ::::::::::::::
 /tmp/foo2
 ::::::::::::::
  /usr/avt/gcc-3.4.6/bin/gcc -I. -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1 -DPHP_ATOM_INC -I/reuter
 s/radt/local/MediaWiki_build/pecl_http-1.6.1/include -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/mai
 n -I/reuters/radt/local/MediaWiki_build/pecl_http-1.6.1 -I/usr/local/include/php -I/usr/local/include/php/main
  -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include
 /php/ext/date/lib -I/usr/local/include -I/usr/local/include/php/ext/hash -DHAVE_CONFIG_H -g -O2 -c /reuters/ra
 dt/local/MediaWiki_build/pecl_http-1.6.1/http.c -fPIC -DPIC -o .libs/http.o 
[2685](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: 
 
This is an extract from .libs/http.o after running /tmp/foo:
 
 9710  } curl_version_info_data;
   9711  # 1732 "/usr/local/include/curl/curl.h" 3
   9712   curl_version_info_data *curl_version_info(CURLversion);
   9713  # 1743 "/usr/local/include/curl/curl.h" 3
   9714   const char *"unknown error";
   9715  # 1754 "/usr/local/include/curl/curl.h" 3
   9716   const char *"unknown error";
   9717  # 1765 "/usr/local/include/curl/curl.h" 3
 
and this is the error from /tmp/foo2 and make (with both gcc 3.4.6 and 4.1.1):
  
[2678](root@ntm-igdev02)~radt/.../pecl_http-1.6.1: /tmp/foo2
In file included from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/php_http.h:58,
                 from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c:20:
/usr/local/include/curl/curl.h:1743: error: syntax error before string constant
/usr/local/include/curl/curl.h:1754: error: syntax error before string constant
In file included from /usr/local/include/curl/curl.h:1783,
                 from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/php_http.h:58,
                 from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c:20:
/usr/local/include/curl/multi.h:208: error: syntax error before string constant
[2679](root@ntm-igdev02)~radt/.../pecl_http-1.6.1:

The relevant source lines are:

  1735   * NAME curl_easy_strerror()
  1736   *
  1737   * DESCRIPTION
  1738   *
  1739   * The curl_easy_strerror function may be used to turn a CURLcode value
  1740   * into the equivalent human readable error string.  This is useful
  1741   * for printing meaningful error messages.
  1742   */
  1743   CURL_EXTERN const char *curl_easy_strerror(CURLcode);
  1744
  1745  /*
  1746   * NAME curl_share_strerror()
  1747   *
  1748   * DESCRIPTION
  1749   *
  1750   * The curl_share_strerror function may be used to turn a CURLSHcode value
  1751   * into the equivalent human readable error string.  This is useful
  1752   * for printing meaningful error messages.
  1753   */
  1754  CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
  
The same happens with multi.h:

In file included from /usr/local/include/curl/curl.h:1746,
                 from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/php_http.h:58,
                 from /reuters/radt/local/MediaWiki_build/pecl_http-1.6.1/http.c:20:
/usr/local/include/curl/multi.h:208: error: syntax error before string constant

but I suspect that there's enough evidence here. If you need me to dig deeper, please send me the details.

Thanks in advance.
 [2008-11-17 10:54 UTC] mike@php.net
In php_http_std_defs.h you see on lines 348-356:

#ifndef HAVE_CURL_SHARE_STRERROR
#	define curl_share_strerror(dummy) "unknown error"
#endif
#ifndef HAVE_CURL_EASY_STRERROR
#	define curl_easy_strerror(dummy) "unknown error"
#endif
#ifndef HAVE_CURL_MULTI_STRERROR
#	define curl_multi_strerror(dummy) "unknown error"
#endif


These constants are declared at config9.m4 on lines 286-297:

PHP_CHECK_LIBRARY(curl, curl_share_strerror, 
	[AC_DEFINE([HAVE_CURL_SHARE_STRERROR], [1], [ ])], [ ],
	[$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
)
PHP_CHECK_LIBRARY(curl, curl_multi_strerror, 
	[AC_DEFINE([HAVE_CURL_MULTI_STRERROR], [1], [ ])], [ ], 
	[$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
)
PHP_CHECK_LIBRARY(curl, curl_easy_strerror,
	[AC_DEFINE([HAVE_CURL_EASY_STRERROR], [1], [ ])], [ ],
	[$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
)


phpize should produce a configure which in turn checks for these functions in your curl library and produces the according config.h, and the output should look like:

checking for curl_share_strerror in -lcurl... yes
checking for curl_multi_strerror in -lcurl... yes
checking for curl_easy_strerror in -lcurl... yes


The produced config.h should have the following lines:

/* */
#define HAVE_CURL_EASY_STRERROR 1

/* */
#define HAVE_CURL_MULTI_STRERROR 1

/* */
#define HAVE_CURL_SHARE_STRERROR 1


If you recently upgraded your curl library try to remove the config.cache file from your pecl_http source directory.

On anything else I'm pretty lost here either, as I've never had to do with solaris.  If it in fact is a configuration problem of pecl_http, which happens on solaris only and you are able to sort out, I'd be glad to include a fix for it with the next release.

Cheers
 [2008-11-18 05:16 UTC] Sam dot Sexton at thomsonreuters dot com
Sigh - the problem was in configure: the stuff in -lcurl 
wasn't found, so I looked in config.log and it told me I 
needed libidn, so after that was installed, make worked 
fine. I reckon configure should have barfed - there are many 
occasions where 'no' is not really a problem, but I'll be 
much more suspicious in future. Many thanks for the advice.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC