I have already installed Apache 2.2.14, PHP 5.3.1 (using mod_fastcgi) and MySQL 5.1.41 - this is working great, but I am now trying to install PHP 5.2.6 (also using mod_fastcgi) so I can use it for testing on other virtualhosts as my host uses this version.
I followed the same procedure in CentOS 5, and earlier versions of Fedora, and it worked fine. I have installed all the dependencies I need. "configure" worked fine, here is my configure command...
./configure \ --prefix=/usr/local/php-5.2.6 \ --enable-bcmath \ --with-bz2 \ --enable-calendar \ --with-curl \ --with-curlwrappers \ --enable-exif \ --enable-ftp \ --with-gd \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --with-gettext \ --with-gmp \ --with-imagick \ --with-imap \ --with-imap-ssl \ --with-kerberos \ --with-ldap \ --enable-libxml \ --enable-mbstring \ --with-mcrypt \ --with-mhash \ --with-mysql \ --with-mysqli \ --with-openssl \ --enable-pdo \ --with-pdo-mysql \ --enable-soap \ --enable-sockets \ --with-tidy \ --with-xmlrpc \ --with-xsl \ --enable-zip \ --with-zlib
But I seem to be getting errors when running "make"... there are alot of errors so I have shown the first and last bit (had to log it to a text file it was so long). I assume I need some compile flags/options to get this to work.
/bin/sh /home/luke/Downloads/php-5.2.6/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/libxml/ -I/home/luke/Downloads/php-5.2.6/ext/libxml/ -DPHP_ATOM_INC -I/home/luke/Downloads/php-5.2.6/include -I/home/luke/Downloads/php-5.2.6/main -I/home/luke/Downloads/php-5.2.6 -I/usr/include/libxml2 -I/home/luke/Downloads/php-5.2.6/ext/date/lib -I/usr/include/ImageMagick -I/usr/include/imap -I/home/luke/Downloads/php-5.2.6/ext/mbstring/oniguruma -I/home/luke/Downloads/php-5.2.6/ext/mbstring/libmbfl -I/home/luke/Downloads/php-5.2.6/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/home/luke/Downloads/php-5.2.6/TSRM -I/home/luke/Downloads/php-5.2.6/Zend -I/usr/include -g -O2 -c /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c -o ext/libxml/libxml.lo In file included from /home/luke/Downloads/php-5.2.6/Zend/zend.h:236, from /home/luke/Downloads/php-5.2.6/main/php.h:34, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/Zend/zend_alloc.h:34: error: expected specifier-qualifier-list before 'uint' /home/luke/Downloads/php-5.2.6/Zend/zend_alloc.h:41: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char' /home/luke/Downloads/php-5.2.6/Zend/zend_alloc.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' /home/luke/Downloads/php-5.2.6/Zend/zend_alloc.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'[/code]
...
/home/luke/Downloads/php-5.2.6/Zend/zend_hash.h:339: note: previous implicit declaration of 'strtol' was here In file included from /home/luke/Downloads/php-5.2.6/main/php.h:234, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/snprintf.h:82: error: expected declaration specifiers or '...' before 'va_list' /home/luke/Downloads/php-5.2.6/main/snprintf.h:84: error: expected declaration specifiers or '...' before 'va_list' In file included from /home/luke/Downloads/php-5.2.6/main/php.h:236, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/spprintf.h:42: error: expected declaration specifiers or '...' before 'va_list' In file included from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/php.h:293: error: expected declaration specifiers or '...' before 'va_list' In file included from /home/luke/Downloads/php-5.2.6/main/php.h:383, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/php_output.h:100: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'extern' In file included from /home/luke/Downloads/php-5.2.6/main/fopen_wrappers.h:25, from /home/luke/Downloads/php-5.2.6/main/php.h:401, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/php_globals.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'struct' In file included from /home/luke/Downloads/php-5.2.6/main/php.h:405, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/TSRM/tsrm_virtual_cwd.h:162: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token In file included from /home/luke/Downloads/php-5.2.6/main/php.h:407, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:60: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:62: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:63: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' /home/luke/Downloads/php-5.2.6/Zend/zend_constants.h:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' In file included from /home/luke/Downloads/php-5.2.6/main/php.h:414, from /home/luke/Downloads/php-5.2.6/ext/libxml/libxml.c:28: /home/luke/Downloads/php-5.2.6/main/php_reentrancy.h:57: error: expected ')' before '*' token make: *** [ext/libxml/libxml.lo] Error 1
I have tried several times now, deleting the folder and files and starting from scratch with a fresh download, still the same ****. I'm sure I've seen this error before but I just can't remember what I did as I always forget to write things down - I usually find hours of frustration is solved by something silly. I got PHP 5.2.12 to compile fine, but ideally I would like to use PHP 5.2.6 to emulate the web host's environment.
I'm not sure if this will help you help me.
[root@localhost php-5.2.6]# gcc -v Using built-in specs. Target: i686-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux Thread model: posix gcc version 4.4.2 20091222 (Red Hat 4.4.2-20) (GCC)
Do I need to provide any more information that could help?