ID: 28930 Comment by: cjs at cynic dot net Reported By: eggert at gnu dot org Status: Open Bug Type: Compile Failure Operating System: Debian GNU/Linux 3.0r1 PHP Version: 4.3.7 New Comment:
Same problem on NetBSD 1.6ZG or 2.0 using PHP 5.0.0 RC3. Similar solution, except that I had to patch a few more files in a similar way. Previous Comments: ------------------------------------------------------------------------ [2004-07-06 20:25:24] eggert at gnu dot org Changing the status back to open, since it's clearly a bug in the PHP build procedure. ------------------------------------------------------------------------ [2004-07-06 20:23:55] eggert at gnu dot org The comments by sniper are incorrect. The PHP 4.3.7 zend_ini_parser.c file was generated by Bison 1.35, not Bison 1.28. A build with Bison 1.28 may or may not work (I haven't checked). But the fundamental problem here is that the PHP 4.3.7 build process is broken: it assumes that any .h file built by any yacc implementation is compatible with any .c file generated by any other yacc implementation. This has never been the case. The proposed patch fixes the PHP build process so that it doesn't assume that all yacc implementations are identical. ------------------------------------------------------------------------ [2004-07-06 11:40:29] mandreiana at yahoo dot com Snipper, not all systems have these bison versions. e.g. Fedora Core 2 has 1.875. Other distros will update it too with new releases. PHP 4.3.7 doesn't compile on these systems, one has to mkdir Zend && cp ../Zend/zend_{language,ini}_parser.[ch] Zend Please fix PHP by using the patch which bison author kindly provided. ------------------------------------------------------------------------ [2004-07-06 01:26:03] [EMAIL PROTECTED] It's working as it should be. (do NOT use anything but 1.35 or rather, 1.28 version of bison!) ------------------------------------------------------------------------ [2004-06-25 22:33:22] eggert at gnu dot org Description: ------------ "make install" fails as described under "actual result". The problem is that the source files are picking up the wrong include files: they should be including the new files generated by Bison 1.875, but they are including the prebuilt files generated by Bison 1.35. Here is a patch. This patch should fix PHP bug 21802. diff -prU2 php-4.3.7/Zend/zend_compile.c php-4.3.7-fix/Zend/zend_compile.c --- php-4.3.7/Zend/zend_compile.c 2003-08-28 09:08:11 -0700 +++ php-4.3.7-fix/Zend/zend_compile.c 2004-06-25 13:11:23 -0700 @@ -19,5 +19,5 @@ -#include "zend_language_parser.h" +#include <zend_language_parser.h> #include "zend.h" #include "zend_compile.h" diff -prU2 php-4.3.7/Zend/zend_highlight.c php-4.3.7-fix/Zend/zend_highlight.c --- php-4.3.7/Zend/zend_highlight.c 2003-12-25 10:57:28 -0800 +++ php-4.3.7-fix/Zend/zend_highlight.c 2004-06-25 13:10:57 -0700 @@ -20,5 +20,5 @@ #include "zend.h" -#include "zend_language_parser.h" +#include <zend_language_parser.h> #include "zend_compile.h" #include "zend_highlight.h" diff -prU2 php-4.3.7/Zend/zend_indent.c php-4.3.7-fix/Zend/zend_indent.c --- php-4.3.7/Zend/zend_indent.c 2002-12-31 08:23:03 -0800 +++ php-4.3.7-fix/Zend/zend_indent.c 2004-06-25 13:11:02 -0700 @@ -23,5 +23,5 @@ #include "zend.h" -#include "zend_language_parser.h" +#include <zend_language_parser.h> #include "zend_compile.h" #include "zend_indent.h" diff -prU2 php-4.3.7/Zend/zend_ini_scanner.l php-4.3.7-fix/Zend/zend_ini_scanner.l --- php-4.3.7/Zend/zend_ini_scanner.l 2003-07-24 01:44:28 -0700 +++ php-4.3.7-fix/Zend/zend_ini_scanner.l 2004-06-25 13:10:34 -0700 @@ -31,5 +31,5 @@ #include "zend.h" #include "zend_globals.h" -#include "zend_ini_parser.h" +#include <zend_ini_parser.h> #include "zend_ini_scanner.h" diff -prU2 php-4.3.7/Zend/zend_language_scanner.l php-4.3.7-fix/Zend/zend_language_scanner.l --- php-4.3.7/Zend/zend_language_scanner.l 2004-02-03 06:31:19 -0800 +++ php-4.3.7-fix/Zend/zend_language_scanner.l 2004-06-25 13:11:16 -0700 @@ -48,5 +48,5 @@ #include "zend.h" #include "zend_alloc.h" -#include "zend_language_parser.h" +#include <zend_language_parser.h> #include "zend_compile.h" #include "zend_language_scanner.h" Reproduce code: --------------- To reproduce the problem, install Bison 1.875 and build PHP 4.3.7 with the following commands: mkdir obj cd obj sh ../php-4.3.7/configure make make install Expected result: ---------------- Expected a clean make install. Actual result: -------------- $ make install Installing PHP SAPI module: cgi Installing PHP CGI into: /tmp/prefix/bin/ Installing PEAR environment: /tmp/prefix/lib/php/ Parse error: syntax error, unexpected T_WHITESPACE in /home/eggert/src/php/php-4.3.7/pear/install-pear.php on line 3 make[1]: *** [install-pear-installer] Error 255 make: *** [install-pear] Error 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28930&edit=1