Cannot build php 5.2.8

#1
Subj.

Here is the configuration string:

--with-pic --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-gettext --with-gmp --with-jpeg-dir=/usr --with-png --with-pspell --with-mcrypt --with-mhash --with-bz2 --with-curl --with-openssl --with-pcre-regex=/usr --enable-exif --enable-ftp --enable-trans-sid --enable-yp --enable-wddx --enable-ucd-snmp-hack --enable-memory-limit --enable-calendar --enable-dbx --without-sqlite --with-libxml-dir=/usr --with-xml --with-mysql --with-odbc --enable-dom --enable-dba --enable-pdo --enable-xmlreader --enable-xmlwriter --with-imap --with-imap-ssl --with-mysqli --with-zlib --with-gd --with-imagick --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --enable-mbstring --with-iconv --with-kerberos
Additional options:
Suhosin (General Hardening)
Mail Header (Identifies Mail Source)
eAccelerator

So, here is last few strings from the log file:

/bin/sh /usr/local/litespeed/phpbuild/php-5.2.8/libtool --silent --preserve-dup-deps --mode=compile gcc -Imain/ -I/usr/local/litespeed/phpbuild/php-5.2.8/main/ -DPHP_ATOM_INC -I/usr/local/litespeed/phpbuild/php-5.2.8/include -I/usr/local/litespeed/phpbuild/php-5.2.8/main -I/usr/local/litespeed/phpbuild/php-5.2.8 -I/usr/include/libxml2 -I/usr/kerberos/include -I/usr/local/litespeed/phpbuild/php-5.2.8/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap -I/usr/local/litespeed/phpbuild/php-5.2.8/ext/mbstring/oniguruma -I/usr/local/litespeed/phpbuild/php-5.2.8/ext/mbstring/libmbfl -I/usr/local/litespeed/phpbuild/php-5.2.8/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/pspell -I/usr/local/litespeed/phpbuild/php-5.2.8/TSRM -I/usr/local/litespeed/phpbuild/php-5.2.8/Zend -I/usr/include -g -O2 -c /usr/local/litespeed/phpbuild/php-5.2.8/main/reentrancy.c -o main/reentrancy.lo
/usr/local/litespeed/phpbuild/php-5.2.8/main/reentrancy.c: In function 'php_readdir_r':
/usr/local/litespeed/phpbuild/php-5.2.8/main/reentrancy.c:139: error: too few arguments to function 'readdir_r'
make: *** [main/reentrancy.lo] Error 1
Litespeed Web Server Enterprise v3.3.24

Please, advice.
 

mistwang

LiteSpeed Staff
#3
Have you tried to build PHP from command line, under /usr/local/litespeed/phpbuild/php-5.2.8
Maybe some configuration option make PHP failed to detect the system readdir_r() function, try with minimum configuration option if it still fail from command line, just do

./configure --with-litespeed

and see if you get the same error, then add a few more options little bit little if it is OK. This way, you can find the option that causes the problem.

If compile fails with minimum options, then there must be something wrong with you system header files or libraries.
 
#4
If I run phpbuild script in the terminal then php will be built successfully, but if I use admin back-end for building php it fails with the mentioned error message.

I'm running the following script:

./phpbuild.1237294521.3.sh

#!/bin/sh
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR ${2}" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
exit ${1}
fi
}

echo "Changing to build directory" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
cd /usr/local/litespeed/phpbuild
check_errs $? "Could not get into build directory"
rm -rf php-5.2.8
check_errs $? "Could not delete old php directory"
echo "Extracting PHP source archive" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
tar -zxf php-5.2.8.tar.gz
check_errs $? "Could not extract PHP source archive"
echo "Retrieving Suhosin patch" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
curl -L -o suhosin-patch-5.2.8.patch.gz http://download.suhosin.org/suhosin-patch-5.2.8-0.9.6.3.patch.gz
check_errs $? "Could not retrieve Suhosin patch"
echo "Extracting Suhosin patch" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
gunzip -f suhosin-patch-5.2.8.patch.gz
check_errs $? "Could not extract Suhosin patch"
echo "Changing to PHP directory" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
cd /usr/local/litespeed/phpbuild/php-5.2.8
check_errs $? "Could not change to PHP directory"
echo "Patching source with Suhosin patch" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
patch -p1 < ../suhosin-patch-5.2.8.patch
check_errs $? "Could not patch source with Suhosin patch"
cd ..
echo "Retrieving mail header patch" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
curl -L -o php-5.2.8-mail-header.patch http://choon.net/opensource/php/php-5.2.8-mail-header.patch
check_errs $? "Could not retrieve mail header patch"
echo "Patching source with mail header patch" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
patch -p0 < php-5.2.8-mail-header.patch
check_errs $? "Could not patch source with mail header patch"
echo "Retrieving LSAPI archive" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
cd php-5.2.8/sapi
check_errs $? "Could not get into php/sapi directory"
curl -L -o php-litespeed-4.8.tgz http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.8.tgz
check_errs $? "Could not retrieve LSAPI archive"
echo "Extracting LSAPI archive" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
tar -xzf php-litespeed-4.8.tgz
check_errs $? "Could not extract LSAPI archive"
echo "Generating configuration script" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
cd ..
check_errs $? "Could not get into php directory"
touch ac*
check_errs $? "Could not touch ac*"
./buildconf --force
check_errs $? "Could not generate configuration script"
echo "Configuring PHP build (2-3 minutes)" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
./configure '--prefix=/usr/local/litespeed/lsphp5' '--with-litespeed' --with-pic --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-gettext --with-gmp --with-jpeg-dir=/usr --with-png --with-pspell --with-mcrypt --with-mhash --with-bz2 --with-curl --with-openssl --with-pcre-regex=/usr --enable-exif --enable-ftp --enable-trans-sid --enable-yp --enable-wddx --enable-ucd-snmp-hack --enable-memory-limit --enable-calendar --enable-dbx --without-sqlite --with-libxml-dir=/usr --with-xml --with-mysql --with-odbc --enable-dom --enable-dba --enable-pdo --enable-xmlreader --enable-xmlwriter --with-imap --with-imap-ssl --with-mysqli --with-zlib --with-gd --with-imagick --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --enable-mbstring --with-iconv --with-kerberos --enable-suhosin
check_errs $? "Could not configure PHP build"
echo "Compiling PHP (5-10 minutes)" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
make
check_errs $? "Could not compile PHP"
echo "PHP build complete" > /usr/local/litespeed/phpbuild/phpbuild.1237294521.3.progress
Please, advice.
 

mistwang

LiteSpeed Staff
#5
Maybe it relates to the memory limit imposed on PHP process, can you please try our 4.0 release? Just change the version number in link to 4.0rc1 package to get it.
 
#6
Maybe it relates to the memory limit imposed on PHP process, can you please try our 4.0 release? Just change the version number in link to 4.0rc1 package to get it.
I have tried but it fails with the same error message, even when I have installed 4.0 Ent Release and tried it with php 5.2.9 version.

Please, advice.
 
Top