PHP8 pear compile issue

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,373
Location
London UK
Compiling PHP 8 went PEAR shaped....... I know, just laugh.

PHP Fatal error: Uncaught Error: Call to undefined function popen() in phar:///usr/local/directadmin/custombuild/php-8.0.3/pear/install-pear-nozlib.phar/OS/Guess.php:254
..
..
Makefile:548: recipe for target 'install-pear-installer' failed
make[1]: *** [install-pear-installer] Error 255
Makefile:551: recipe for target 'install-pear' failed
make: *** [install-pear] Error 2
Is is due to secure_php or what would this be?
I still have an unused /usr/local/php56, but I doubt it's that.
 
I do disable functions, but seems crazy it looks for that .ini for compiling situations
Code:
 secure_phpini: /usr/local/lib/php.ini secured
Any reason that is secured? Is it because I had just 1 PHP years ago, safe to delete, or is it used for php-cli?
 
here is what I have
#PHP Settings
php1_release=7.4
php1_mode=php-fpm
php2_release=no
php2_mode=php-fpm
php3_release=no
php3_mode=php-fpm
php4_release=no
php4_mode=php-fpm
secure_php=no
php_ini=no
php_timezone=
php_ini_type=production
x_mail_header=yes
 
I ran into this problem as well today...

TLDR: remove popen from the secure_php list

Step 1

Bash:
# Set Settings for Disabled PHP Functions (removing popen from the default list)

cd /usr/local/directadmin/custombuild
echo "exec,system,passthru,shell_exec,proc_close,proc_open,dl,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname" > custom/php_disable_functions

# Rewrite the php.ini files
./build secure_php

Step 2

Bash:
# Reinstall PHP (all versions as per options.conf)
cd /usr/local/directadmin/custombuild
./build php

Bash:
Copying php.ini..
/usr/local/php80/lib/php.ini already exists, skipping.
Enabling  mail.add_x_header option in /usr/local/php80/lib/php.ini
Creating symlink for /usr/local/php80/bin/php80...
Creating symlink for /usr/local/php80/bin/lsphp80...
Creating symlink for /usr/local/php80/bin/php-cgi80...
Creating symlink for /usr/local/php80/bin/php-config80...
Creating symlink for /usr/local/php80/bin/phpize80...
Failed to restart php-fpm80.service: Unit php-fpm80.service failed to load: No such file or directory.
Failed to execute operation: No such file or directory
PHP has been secured.
Restarting php-fpm73.
Restarting php-fpm74.
Restarting php-fpm80.
opCache is now installed for PHP 8.0.
Downloading updated /usr/lib/ssl/cert.pem
Downloading             cacert.pem...
converted 'https://files.directadmin.com/services/custombuild/all/ssl/cacert.pem' (ANSI_X3.4-1968) -> 'https://files.directadmin.com/services/custombuild/all/ssl/cacert.pem' (UTF-8)
--2021-05-27 15:35:12--  https://files.directadmin.com/services/custombuild/all/ssl/cacert.pem
Resolving files.directadmin.com (files.directadmin.com)... 185.42.221.168, 69.162.69.58, 104.128.54.74
Connecting to files.directadmin.com (files.directadmin.com)|185.42.221.168|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 206919 (202K)
Saving to: '/usr/local/directadmin/custombuild/cacert.pem'

/usr/local/directadmin/custombuild/ 100%[====================================================================>] 202.07K  --.-KB/s   in 0.03s

2021-05-27 15:35:12 (5.97 MB/s) - '/usr/local/directadmin/custombuild/cacert.pem' saved [206919/206919]

Enabling php-fpm80 in systemd...
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm80.service to /etc/systemd/system/php-fpm80.service.
Restarting apache.
Rewriting all users httpd.conf files, please wait...
Debug mode. Level 10

dataskq: command: action=rewrite&value=httpd
PHP 8.0.6 Installed.
 
We are having same problems in various server with CentOS 8
This is our configuration:


#PHP Settings
php1_release=7.4
php1_mode=php-fpm
php2_release=7.2
php2_mode=php-fpm
php3_release=5.6
php3_mode=php-fpm
php4_release=8.1
php4_mode=php-fpm
secure_php=no
php_ini=no
php_timezone=Europe/Madrid
php_ini_type=production
x_mail_header=yes


And this is the error we get with custombuild:

/bin/sh /usr/local/directadmin/custombuild/php-8.1.4/libtool --silent --preserve-dup-deps --tag CC --mode=link cc -shared -I/usr/local/directadmin/custombuild/php-8.1.4/include -I/usr/local/directadmin/custombuild/php-8.1.4/main -I/usr/local/directadmin/custombuild/php-8.1.4 -I/usr/local/directadmin/custombuild/php-8.1.4/ext/date/lib -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/freetype2 -I/usr/local/icu/include -I/usr/local/directadmin/custombuild/php-8.1.4/ext/mbstring/libmbfl -I/usr/local/directadmin/custombuild/php-8.1.4/ext/mbstring/libmbfl/mbfl -I/usr/local/directadmin/custombuild/php-8.1.4/TSRM -I/usr/local/directadmin/custombuild/php-8.1.4/Zend -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -o ext/opcache/opcache.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/directadmin/custombuild/php-8.1.4/modules -avoid-version -module -L/usr/local/lib -L/usr/local/icu/lib -L/usr/local/lib64 ext/opcache/ZendAccelerator.lo ext/opcache/zend_accelerator_blacklist.lo ext/opcache/zend_accelerator_debug.lo ext/opcache/zend_accelerator_hash.lo ext/opcache/zend_accelerator_module.lo ext/opcache/zend_persist.lo ext/opcache/zend_persist_calc.lo ext/opcache/zend_file_cache.lo ext/opcache/zend_shared_alloc.lo ext/opcache/zend_accelerator_util_funcs.lo ext/opcache/shared_alloc_shm.lo ext/opcache/shared_alloc_mmap.lo ext/opcache/shared_alloc_posix.lo ext/opcache/jit/zend_jit.lo ext/opcache/jit/zend_jit_gdb.lo ext/opcache/jit/zend_jit_vm_helpers.lo -lrt

/bin/sh /usr/local/directadmin/custombuild/php-8.1.4/libtool --silent --preserve-dup-deps --tag CC --mode=install cp ext/opcache/opcache.la /usr/local/directadmin/custombuild/php-8.1.4/modules

Build complete.
Don't forget to run 'make test'.

Make Complete
Installing php...
Installing PHP SAPI module: embed
Installing shared extensions: /usr/local/php81/lib/php/extensions/no-debug-non-zts-20210902/
Installing PHP CLI binary: /usr/local/php81/bin/
Installing PHP CLI man page: /usr/local/php81/php/man/man1/
Installing PHP FPM binary: /usr/local/php81/sbin/
Installing PHP FPM defconfig: skipping
Installing PHP FPM man page: /usr/local/php81/php/man/man8/
Installing PHP FPM status page: /usr/local/php81/php/php/fpm/
Installing PHP LiteSpeed binary: /usr/local/php81/bin/
Installing phpdbg binary: /usr/local/php81/bin/
Installing phpdbg man page: /usr/local/php81/php/man/man1/
Installing PHP CGI binary: /usr/local/php81/bin/
Installing PHP CGI man page: /usr/local/php81/php/man/man1/
Installing build environment: /usr/local/php81/lib/php/build/
Installing header files: /usr/local/php81/include/php/
Installing helper programs: /usr/local/php81/bin
program: phpize81
program: php-config81
Installing man pages: /usr/local/php81/php/man/man1/
page: phpize81.1
page: php-config81.1
Installing PEAR environment: /usr/local/php81/lib/php/
make[1]: *** [Makefile:536: install-pear-installer] Segmentation fault (core dumped)
make: *** [Makefile:541: install-pear] Error 2
 
Last edited:
Also had the exact same error when compiling PHP 8.1 on a fresh Directadmin install :
Code:
make[1]: *** [Makefile:536: install-pear-installer] Segmentation fault (core dumped)
make: *** [Makefile:541: install-pear] Error 2

Morala, have you been able to fix this ?
 
A bit strange. I have this to on all the Directadmin servers.
Isn't there serious a work around that will work?
When I look in CustomBuild there I see Current Version 0
 
Back
Top