DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

PHP 7.x build fails on CentOS 5 with an error undefined reference to isfinite

| 14:42:25 08.07.2017

If you still run a server with CentOS 5.x and want to install PHP 7.x on the server with Directadmin and build process interrupts with an error "undefined reference to isfinite":

ext/standard/.libs/var.o: In function `php_var_export_ex':
/usr/local/directadmin/custombuild/php-7.0.21/ext/standard/var.c:469: undefined reference to `isfinite'
main/.libs/php_variables.o: In function `zend_dval_to_lval':
/usr/local/directadmin/custombuild/php-7.0.21/Zend/zend_operators.h:117: undefined reference to `isfinite'
Zend/.libs/zend_operators.o: In function `zendi_smart_strcmp':
/usr/local/directadmin/custombuild/php-7.0.21/Zend/zend_operators.c:2774: undefined reference to `isfinite'
Zend/.libs/zend_operators.o: In function `zend_dval_to_lval':
/usr/local/directadmin/custombuild/php-7.0.21/Zend/zend_operators.h:117: undefined reference to `isfinite'
/usr/local/directadmin/custombuild/php-7.0.21/Zend/zend_operators.h:117: undefined reference to `isfinite'
Zend/.libs/zend_operators.o:/usr/local/directadmin/custombuild/php-7.0.21/Zend/zend_operators.h:117: more undefined references to `isfinite' follow
collect2: ld returned 1 exit status
make: *** [sapi/phpdbg/phpdbg] Error 1

*** The make has failed, would you like to try to make again? (y,n): n

[root@directadmin custombuild]#

Here you can find one of possible solutions (choose the mode you use):

PHP 7.0 as mod_php

cd /usr/local/directadmin/custombuild
mkdir -p ./custom/ap2/
[ -e "./custom/ap2/configure.php70" ] || cp -p ./configure/ap2/configure.php70 ./custom/ap2/

PHP 7.0 as FastCGI

cd /usr/local/directadmin/custombuild
mkdir -p ./custom/fastcgi/
[ -e "./custom/fastcgi/configure.php70" ] || cp -p ./configure/fastcgi/configure.php70 ./custom/fastcgi/

PHP 7.0 as FPM

cd /usr/local/directadmin/custombuild
mkdir -p ./custom/fpm/
[ -e "./custom/fpm/configure.php70" ] || cp -p ./configure/fpm/configure.php70 ./custom/fpm/

PHP 7.0 as suPHP

cd /usr/local/directadmin/custombuild
mkdir -p ./custom/suphp/
[ -e "./custom/suphp/configure.php70" ] || cp -p ./configure/suphp/configure.php70 ./custom/suphp/

For PHP 7.1 do the same but with configure.php71.

Once you've copied the configure.php70 and/or configure.php71 file to the custom directory you need to open the copied version in an editor and change the following lines:

./configure \


./buildconf --force
perl -pi -e 's/if test "x\$ac_cv_have_decl_isfinite/if test "x\$ac_cv_have_decl_isfiniteNaNa/' ./configure
./configure \

save and close the file.

And try to build PHP once more time with:

cd /usr/local/directadmin/custombuild/
./build update
./build clean
./build php

And see how the process goes. 

Build process might fail due to outdated OpenSSL version, and in this case you will probably need to build the second instance of OpenSSL into /usr/local/ssl/ for example and build PHP against it.


About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.

All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition