php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65460 PHP 5.4.18 fails to compile with Apache 2.4.6
Submitted: 2013-08-16 13:40 UTC Modified: 2013-08-19 20:15 UTC
Votes:9
Avg. Score:4.4 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:8 (100.0%)
Same OS:2 (25.0%)
From: stu at coe dot uky dot edu Assigned: stas (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.4.18 OS: Slackware64 14.0
Private report: No CVE-ID: None
 [2013-08-16 13:40 UTC] stu at coe dot uky dot edu
Description:
------------
On machines with Apache 2.4.6, when compiling PHP 5.4.18, it fails with the error: /usr/src/php-5.4.18/Zend/zend_language_parser.h:327:5: error: conflicting types for 'zendparse'


Test script:
---------------
My configure (which works with Apache 2.2.25) is:
CFLAGS="-mtune=native" CPPFLAGS="-mtune=native" ./configure --with-mysql=/home/mysql --with-apxs2=/home/httpd/bin/apxs --with-curl


Expected result:
----------------
I expected PHP 5.4.18 to compile

Actual result:
--------------
On machines with Apache 2.4.6, compiling fails. (Seen on two different machines, so far)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-16 16:59 UTC] ben dot harper at rackspace dot com
I am running into this same error on RHEL 5 with Apache 2.2.3 and RHEL 6 with 
2.2.15.  Same config on both but slightly different error:

%configure \
	--cache-file=../config.cache \
        --with-libdir=%{_lib} \
	--with-config-file-path=%{_sysconfdir} \
	--with-config-file-scan-dir=%{_sysconfdir}/php.d \
	--disable-debug \
	--with-pic \
	--disable-rpath \
	--without-pear \
	--with-bz2 \
	--with-exec-dir=%{_bindir} \
	--with-freetype-dir=%{_prefix} \
	--with-png-dir=%{_prefix} \
	--with-xpm-dir=%{_prefix} \
	--enable-gd-native-ttf \
	--with-t1lib=%{_prefix} \
	--without-gdbm \
	--with-gettext \
	--with-gmp \
	--with-iconv \
	--with-jpeg-dir=%{_prefix} \
	--with-openssl \
        --with-pcre-regex \
	--with-zlib \
	--with-layout=GNU \
	--enable-exif \
	--enable-ftp \
	--enable-magic-quotes \
	--enable-sockets \
	--with-kerberos \
	--enable-ucd-snmp-hack \
	--enable-shmop \
	--enable-calendar \
        --with-libxml-dir=%{_prefix} \
	--enable-xml \
        --with-system-tzdata \
	--with-mhash \

Error in RHEL 5:

In file included from /builddir/build/BUILD/php-
5.4.18/ext/standard/basic_functions.c:48:
/builddir/build/BUILD/php-5.4.18/Zend/zend_language_parser.h:327: error: 
conflicting types for 'zendparse'
/builddir/build/BUILD/php-5.4.18/Zend/zend_globals_macros.h:35: error: previous 
declaration of 'zendparse' was here
/bin/sh /builddir/build/BUILD/php-5.4.18/build-ztscli/libtool --silent --
preserve-dup-deps --mode=compile /builddir/build/BUILD/php-5.4.18/build-
ztscli/meta_ccld  -Iext/standard/ -I/builddir/build/BUILD/php-
5.4.18/ext/standard/ -DPHP_ATOM_INC -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/include -I/builddir/build/BUILD/php-5.4.18/build-ztscli/main -
I/builddir/build/BUILD/php-5.4.18 -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/date/lib -I/builddir/build/BUILD/php-5.4.18/ext/date/lib -
I/builddir/build/BUILD/php-5.4.18/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/kerberos/include -I/usr/include/enchant -I/usr/include/freetype2 -
I/usr/include/imap -I/usr/lib/firebird/include -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl/mbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/TSRM -I/builddir/build/BUILD/php-
5.4.18/build-ztscli/Zend -I/builddir/build/BUILD/php-5.4.18/main -
I/builddir/build/BUILD/php-5.4.18/Zend -I/builddir/build/BUILD/php-5.4.18/TSRM -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/  -D_REENTRANT  -I/usr/include -
O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-
tables -fno-strict-aliasing -Wno-pointer-sign -fvisibility=hidden -pthread -DZTS  
-c /builddir/build/BUILD/php-5.4.18/ext/standard/filestat.c -o 
ext/standard/filestat.lo 
make: *** [ext/standard/basic_functions.lo] Error 1
make: *** Waiting for unfinished jobs....
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_array_diff':
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3418: warning: 
'fci_key_cache' may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3417: warning: 'fci_key' 
may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_array_intersect':
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3000: warning: 
'fci_key_cache' may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:2999: warning: 'fci_key' 
may be used uninitialized in this function
error: Bad exit status from /var/tmp/rpm-tmp.71866 (%build)
    Bad exit status from /var/tmp/rpm-tmp.71866 (%build)
RPM build errors:
Child return code was: 1

Error in RHEL 6:

In file included from /builddir/build/BUILD/php-
5.4.18/ext/standard/basic_functions.c:49:
/builddir/build/BUILD/php-5.4.18/Zend/zend_language_parser.h:327: error: 
conflicting types for 'zendparse'
/builddir/build/BUILD/php-5.4.18/Zend/zend_globals_macros.h:35: note: previous 
declaration of 'zendparse' was here
/bin/sh /builddir/build/BUILD/php-5.4.18/build-ztscli/libtool --silent --
preserve-dup-deps --mode=compile /builddir/build/BUILD/php-5.4.18/build-
ztscli/meta_ccld  -Iext/standard/ -I/builddir/build/BUILD/php-
5.4.18/ext/standard/ -DPHP_ATOM_INC -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/include -I/builddir/build/BUILD/php-5.4.18/build-ztscli/main -
I/builddir/build/BUILD/php-5.4.18 -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/date/lib -I/builddir/build/BUILD/php-5.4.18/ext/date/lib -
I/builddir/build/BUILD/php-5.4.18/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/include/enchant -I/usr/include/freetype2 -I/usr/include/imap -
I/usr/lib64/firebird/include -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/oniguruma -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl -I/builddir/build/BUILD/php-
5.4.18/ext/mbstring/libmbfl/mbfl -I/builddir/build/BUILD/php-5.4.18/build-
ztscli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/TSRM -I/builddir/build/BUILD/php-
5.4.18/build-ztscli/Zend -I/builddir/build/BUILD/php-5.4.18/main -
I/builddir/build/BUILD/php-5.4.18/Zend -I/builddir/build/BUILD/php-5.4.18/TSRM -
I/builddir/build/BUILD/php-5.4.18/build-ztscli/  -D_REENTRANT  -I/usr/include -
O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -Wno-pointer-
sign -fvisibility=hidden -pthread -DZTS  -c /builddir/build/BUILD/php-
5.4.18/ext/standard/dir.c -o ext/standard/dir.lo 
make: *** [ext/standard/basic_functions.lo] Error 1
make: *** Waiting for unfinished jobs....
/builddir/build/BUILD/php-5.4.18/ext/standard/browscap.c: In function 
'zm_startup_browscap':
/builddir/build/BUILD/php-5.4.18/ext/standard/browscap.c:339: warning: passing 
argument 3 of 'ts_allocate_id' from incompatible pointer type
/builddir/build/BUILD/php-5.4.18/Zend/../TSRM/TSRM.h:111: note: expected 
'ts_allocate_ctor' but argument is of type 'void (*)(struct 
zend_browscap_globals *, void ***)'
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_array_intersect':
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:2999: warning: 'fci_key' 
may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3000: warning: 
'fci_key_cache' may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c: In function 
'php_array_diff':
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3417: warning: 'fci_key' 
may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/standard/array.c:3418: warning: 
'fci_key_cache' may be used uninitialized in this function
/builddir/build/BUILD/php-5.4.18/ext/date/lib/parse_date.c: In function 
'timelib_parse_from_format':
/builddir/build/BUILD/php-5.4.18/ext/date/lib/parse_date.c:25028: warning: value 
computed is not used
error: Bad exit status from /var/tmp/rpm-tmp.tCebX6 (%build)
    Bad exit status from /var/tmp/rpm-tmp.tCebX6 (%build)
RPM build errors:
Child return code was: 1
 [2013-08-18 02:16 UTC] giamteckchoon at gmail dot com
I overcome this error by following the steps outline in https://bugs.php.net/bug.php?id=64503 (note you need to install bison):

1. Apply the patch at https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build_2.patch&revision=latest

2. rm -f Zend/zend_{language,ini}_parser.[ch]

3. Regenerate Zend/zend_language_parser.c etc.
./genfiles

4. Compile as usual.

Tested in SL6.4/CentOS6.4.

Hope this helps!
 [2013-08-18 19:11 UTC] mike@php.net
-Assigned To: +Assigned To: stas
 [2013-08-18 19:11 UTC] mike@php.net
Looks like something was wrongly or not completely merged into 5.4?
 [2013-08-19 00:28 UTC] stas@php.net
5.4 compiles fine for me on CentOS 6.3 and on Mac. Apache is older there but I 
don't think this should have any consequence for zendparse.
 [2013-08-19 07:03 UTC] mike@php.net
I also doubt that it's about Apache, but rather about ZTS.  Looking at the 
tarball files I see:

in zend_global_macros.h:
/* Compiler */
#ifdef ZTS
# define CG(v) TSRMG(compiler_globals_id, zend_compiler_globals *, v)
int zendparse(void *compiler_globals);
#else
# define CG(v) (compiler_globals.v)
extern ZEND_API struct _zend_compiler_globals compiler_globals;
int zendparse(void);
#endif


Note the #ifdef ZTS zendparse declaration



...and in zend_language_parser.h:


#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int zendparse (void *YYPARSE_PARAM);
#else
int zendparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int zendparse (void);
#else
int zendparse ();
#endif
#endif /* ! YYPARSE_PARAM */

...where YYPARSE_PARAM is defined in the source (.c) file.
 [2013-08-19 07:10 UTC] stas@php.net
Mike, so which options should I use to reproduce it? Because I used with-apxs2 
and it worked fine. Should apache be built with some special options? IIRC, it 
usually does not build ZTS version, so what is the config for you that doesn't 
work?
 [2013-08-19 07:37 UTC] mike@php.net
Sorry for not being explicit enough!

I can reproduce with 

$ ./configure --enable-maintainer-zts --disable-all --prefix=$(pwd)/usr 

so, enabling ZTS should cause the issue.
 [2013-08-19 12:05 UTC] remi@php.net
I think this is the same issue than #64503, caused by the switch from Bison 2.3 to 2.7, used to generate the parser.

Notice : the fix for this issue have only been applied in 5.5 tree.
 [2013-08-19 13:48 UTC] stu at coe dot uky dot edu
Applying the patch (at https://bugs.php.net/patch-display.php?bug_id=64503&patch=bison_build_2.patch&revision=latest) and doing the other steps:
rm Zend/zend_{language,ini}_parser.[ch]
./genfiles
fixed the problem.

FYI Slackware 14.0 ships with bison (GNU Bison) 2.5.1

Thanks to all!
 [2013-08-19 17:46 UTC] stas@php.net
OK, looks like the patch for bug #64503 should be applied to 5.4 too for it to 
work with bison 2.7.
 [2013-08-19 18:34 UTC] ben dot harper at rackspace dot com
Like giamteckchoon, I did not get this error with this solution on RHEL 6, but 
not RHEL 5.  I get the following error:

+ rm Zend/zend_language_parser.c Zend/zend_language_parser.h 
Zend/zend_ini_parser.c Zend/zend_ini_parser.h
+ ./genfiles                                                                   
Zend/zend_language_parser.y:50.1-5: invalid directive: `%code'                 
Zend/zend_language_parser.y:50.7-14: syntax error, unexpected identifier       

I updated the patch to the following to get around this error:

$ cat SOURCES/php-5.4.18-bison.patch 
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index ccbc9b1..6a9a24a 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -41,17 +41,19 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
 
 #define YYERROR_VERBOSE
 #define YYSTYPE znode
-#ifdef ZTS
-# define YYPARSE_PARAM tsrm_ls
-# define YYLEX_PARAM tsrm_ls
-#endif
-
 
 %}
 
 %pure_parser
 %expect 3
 
+%{
+#ifdef ZTS
+# define YYPARSE_PARAM tsrm_ls
+# define YYLEX_PARAM tsrm_ls
+#endif
+%}
+
 %token END 0 "end of file"
 %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
 %token T_INCLUDE      "include (T_INCLUDE)"


Does this change seem sane?
 [2013-08-19 20:15 UTC] stas@php.net
-Status: Assigned +Status: Closed
 [2013-08-19 20:15 UTC] stas@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-08-21 11:55 UTC] cyrus at safe-mail dot net
I had the same issue on apache 2.2.25.
The Snapshot works great on my side. Our nightly will use 5.4.17, till it's fixed in a stable release.
Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 06:01:28 2024 UTC