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:
#!/bin/sh ./configure \
to
#!/bin/sh ./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.
Related: