We have an issue with pcntl support for PHP 8.4

SanderJ

Verified User
Joined
Feb 22, 2023
Messages
27
We have an issue with pcntl support for PHP 8.4:

I have added
Code:
--enable-pcntl
to
Code:
/usr/local/directadmin/custombuild/custom/php/configure.php84
, and did a new build for php.
Custombuild logs shows:

checking whether to enable pcntl support... yes
Also, the custom php84 config file is used by DirectAdmin:

[root@server1 ~]# da build used_configs
PHP 8.4 php.ini file: /usr/local/php84/lib/php.ini
PHP 8.4 configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php84

But after the rebuild, there is no pcntl support for php8.4. This sollution works fine for php8.2 / php8.3.

DirectAdmin: v1.675 bcd6e3bf4a4dbfaeb423aae49ad2a0fd77206d7f
OS: AlmaLinux release 8.10 (Cerulean Leopard)
 
But after the rebuild, there is no pcntl support for php8.4. This sollution works fine for php8.2 / php8.3.


It should work. I've got it working on AlmaLinux release 8.10. How do you check its working on your end?
 

Attachments

  • 2025-04-18 19.07.14_.png
    2025-04-18 19.07.14_.png
    59.3 KB · Views: 15
Bash:
[root@server1 ~]# php -v
PHP 8.4.5 (cli) (built: Apr 14 2025 10:39:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.5, Copyright (c), by Zend Technologies

[root@server1 ~]# php -i | grep pcntl

[root@server1 ~]# php -i | grep configure
Configure Command =>  './configure'  '--with-pic' '--enable-embed' '--prefix=/usr/local/php84' '--enable-fpm' '--with-fpm-systemd' '--enable-litespeed' '--with-config-file-scan-dir=/usr/local/php84/lib/php.conf.d' '--with-curl' '--enable-gd' '--with-gettext' '--with-jpeg' '--with-freetype' '--with-ffi' '--with-openssl' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-pear' '--with-sodium' '--with-webp' '--with-xsl' '--with-zlib' '--with-zip' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-shmop' '--enable-sysvshm' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sockets' '--enable-soap' '--enable-mbstring' '--enable-intl' 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:'


Bash:
[root@server1 ~]# cat /usr/local/directadmin/custombuild/custom/php/configure.php84
#!/bin/sh

# Add stack canaries
export CFLAGS="${CFLAGS} -fstack-protector-strong"

# Fortify core stdlib functions
export CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=1 -O1"

./configure \
        --with-pic \
        --enable-embed \
        --prefix=/usr/local/php84 \
        --program-suffix=84 \
        --enable-fpm \
        --with-fpm-systemd \
        --enable-litespeed \
        --with-config-file-scan-dir=/usr/local/php84/lib/php.conf.d \
        --with-curl \
        --enable-gd \
        --with-gettext \
        --with-jpeg \
        --with-freetype \
        --with-ffi \
        --with-openssl \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-sodium \
        --with-webp \
        --with-xsl \
        --with-zlib \
        --with-zip \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-shmop \
        --enable-sysvshm \
        --enable-sysvmsg \
        --enable-sysvsem \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --enable-intl \
        --enable-pcntl


Bash:
[root@server1 ~]# da build used_configs
Nginx configuration file: /usr/local/directadmin/custombuild/custom/nginx/configure.nginx
PHP 8.3 php.ini file: /usr/local/php83/lib/php.ini
PHP 8.3 configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php83
PHP 8.4 php.ini file: /usr/local/php84/lib/php.ini
PHP 8.4 configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php84
ProFTPD configuration file: /usr/local/directadmin/custombuild/configure/proftpd/configure.proftpd
ImageMagick configuration file: /usr/local/directadmin/custombuild/configure/imagemagick/configure.imagemagick
Exim Makefile: /usr/local/directadmin/custombuild/configure/exim/MakefileDovecot configuration file: /usr/local/directadmin/custombuild/configure/dovecot/configure.dovecot
phpMyAdmin configuration file: /usr/local/directadmin/custombuild/configure/phpmyadmin/config.inc.php

I have the same custom config for php8.3, and that is working just fine.

Looking at the build date of php8.4, it seems that the binary was not rebuild. It should be dated to April 17th. Custombuild logs show "Build complete." and no errors on the last build.
 
Last edited:
Just tested
Code:
da build php 8.4
. The output:


Code:
(cd .libs && rm -f redis.la && ln -s ../redis.la redis.la)
/bin/sh /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/libtool --tag=CC --mode=install cp ./redis.la /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/modules
cp ./.libs/redis.so /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/modules/redis.so
cp ./.libs/redis.lai /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/modules/redis.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/directadmin/custombuild/tmp/tmp.zgH1RIVzNS.redis-pecl-6.2.0.tgz/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

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

Installing shared extensions:     /usr/local/php84/lib/php/extensions/no-debug-non-zts-20240924/
Restarting nginx.
Rewriting all users nginx.conf files, please wait...
2025/04/22 10:38:12  info executing task            task=action=rewrite&value=nginx
2025/04/22 10:38:18  info finished task             duration=5.631259035s task=action=rewrite&value=nginx
PHP 8.4.5 Installed.

But when I look at the binary:

Code:
[root@server1 bin]# ll /usr/local/php84/bin/php
-rwxr-xr-x 1 root root 25203024 14 apr 10:40 /usr/local/php84/bin/php

[root@server1 bin]# ll /usr/local/php84/bin/php84
lrwxrwxrwx 1 root root 24 22 apr 10:37 /usr/local/php84/bin/php84 -> /usr/local/php84/bin/php


Code:
[root@server1 bin]# /usr/local/php84/bin/php -v
PHP 8.4.5 (cli) (built: Apr 14 2025 10:39:21) (NTS)
 
Those final lines from redis-pecl installation, not PHP. You will need to copy and show lines from PHP installation. In order to captcha the lines you might redirect output to a file, or disable PHP extensions temporary.
 
Hereby the logs, just before the compiling of imagick:

/bin/sh /usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/libtool --silent --preserve-dup-deps --tag=CC --mode=link cc -shared -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4
.5.tar.gz/main -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/ext/date/lib -I/usr/include/libxml2 -I/usr/include
/libpng16 -I/usr/include/freetype2 -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/ext/mbstring/libmbfl -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/ext/mbstr
ing/libmbfl/mbfl -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/TSRM -I/usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/Zend -D_GNU_SOURCE -fno-common -Wstrict-p
rototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -fstack-protector-strong -D_FORTIFY_SOURCE=1 -O1 -ffp-contract=off -fvisibility=h
idden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -Wl,-z,relro,-z,now -s -fPIC -pie -o ext/opcache/opcache.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/directadmin/custombuild/tmp/tmp.
1IDv1RkZN7.php-8.4.5.tar.gz/modules -avoid-version -module ext/opcache/shared_alloc_mmap.lo ext/opcache/shared_alloc_posix.lo ext/opcache/shared_alloc_shm.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_accelerator_util_funcs.lo ext/opcache/zend_file_cache.lo ext/opcache/zend_persist_calc.lo e
xt/opcache/zend_persist.lo ext/opcache/zend_shared_alloc.lo ext/opcache/ZendAccelerator.lo ext/opcache/jit/ir/ir_cfg.lo ext/opcache/jit/ir/ir_check.lo ext/opcache/jit/ir/ir_dump.lo ext/opcache/jit/ir/ir_emit.lo
ext/opcache/jit/ir/ir_gcm.lo ext/opcache/jit/ir/ir_gdb.lo ext/opcache/jit/ir/ir_patch.lo ext/opcache/jit/ir/ir_perf.lo ext/opcache/jit/ir/ir_ra.lo ext/opcache/jit/ir/ir_save.lo ext/opcache/jit/ir/ir_sccp.lo ext/
opcache/jit/ir/ir_strtab.lo ext/opcache/jit/ir/ir.lo ext/opcache/jit/zend_jit_vm_helpers.lo ext/opcache/jit/zend_jit.lo -lrt
/bin/sh /usr/local/directadmin/custombuild/tmp/tmp.1IDv1RkZN7.php-8.4.5.tar.gz/libtool --silent --preserve-dup-deps --tag=CC --mode=install cp ext/opcache/opcache.la /usr/local/directadmin/custombuild/tmp/tmp.1I
Dv1RkZN7.php-8.4.5.tar.gz/modules

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

Installing PHP 8.4 ...
Installing PHP SAPI module: embed
Installing shared extensions: /usr/local/php84/lib/php/extensions/no-debug-non-zts-20240924/
Installing PHP CLI binary: /usr/local/php84/bin/
Installing PHP CLI man page: /usr/local/php84/php/man/man1/
Installing PHP FPM binary: /usr/local/php84/sbin/
Installing PHP FPM defconfig: skipping
Installing PHP FPM man page: /usr/local/php84/php/man/man8/
Installing PHP FPM status page: /usr/local/php84/php/php/fpm/
Installing PHP LiteSpeed binary: /usr/local/php84/bin/
Installing phpdbg binary: /usr/local/php84/bin/
Installing phpdbg man page: /usr/local/php84/php/man/man1/
Installing PHP CGI binary: /usr/local/php84/bin/
Installing PHP CGI man page: /usr/local/php84/php/man/man1/
Installing build environment: /usr/local/php84/lib/php/build/
Installing header files: /usr/local/php84/include/php/
Installing helper programs: /usr/local/php84/bin/
program: phpize84
program: php-config84
Installing man pages: /usr/local/php84/php/man/man1/
page: phpize84.1
page: php-config84.1
Installing PEAR environment: /usr/local/php84/lib/php/
[PEAR] Archive_Tar - already installed: 1.5.0
[PEAR] Console_Getopt - already installed: 1.4.3
[PEAR] Structures_Graph- already installed: 1.2.0
[PEAR] XML_Util - already installed: 1.4.5
[PEAR] PEAR - already installed: 1.10.16
Warning! a PEAR user config file already exists from a previous PEAR installation at '/root/.pearrc'. You may probably want to remove it.
Wrote PEAR system config file at: /usr/local/php84/etc/pear.conf
You may want to add: /usr/local/php84/lib/php to your php.ini include_path
Creating symlink /usr/local/php84/bin/php84 -> /usr/local/php84/bin/php
Creating symlink /usr/local/php84/bin/lsphp84 -> /usr/local/php84/bin/lsphp
Creating symlink /usr/local/php84/bin/php-cgi84 -> /usr/local/php84/bin/php-cgi
Creating symlink /usr/local/php84/bin/php-config84 -> /usr/local/php84/bin/php-config
Creating symlink /usr/local/php84/bin/phpize84 -> /usr/local/php84/bin/phpize
Creating symlink /usr/local/php84/sbin/php-fpm84 -> /usr/local/php84/sbin/php-fpm
compiling imagick-3.7.0 for PHP 8.4...
 
@SanderJ
First, we need to recovery build system, remove '--enable-pcntl' and re-build again, then check script building success or not.
Code:
stat /usr/local/php84/bin/php

if remove '--enable-pcntl' from configuration and still not success, then we need to dig more than this.
 
Found probably the same issue on Debian 12.10 when tried to upgrade PHP 8.4.5 to 8.4.6.

Though the installation/compilation process did not report any error

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

Installing PHP 8.4 ...
Installing PHP SAPI module:       embed
Installing shared extensions:     /usr/local/php84/lib/php/extensions/no-debug-non-zts-20240924/
Installing PHP CLI binary:        /usr/local/php84/bin/
Installing PHP CLI man page:      /usr/local/php84/php/man/man1/
Installing PHP FPM binary:        /usr/local/php84/sbin/
Installing PHP FPM defconfig:     /usr/local/php84/etc/
Installing PHP FPM man page:      /usr/local/php84/php/man/man8/
Installing PHP FPM status page:   /usr/local/php84/php/php/fpm/
Installing PHP LiteSpeed binary:  /usr/local/php84/bin/
Installing phpdbg binary:         /usr/local/php84/bin/
Installing phpdbg man page:       /usr/local/php84/php/man/man1/
Installing PHP CGI binary:        /usr/local/php84/bin/
Installing PHP CGI man page:      /usr/local/php84/php/man/man1/
Installing build environment:     /usr/local/php84/lib/php/build/
Installing header files:          /usr/local/php84/include/php/
Installing helper programs:       /usr/local/php84/bin/
  program: phpize84
  program: php-config84
Installing man pages:             /usr/local/php84/php/man/man1/
  page: phpize84.1
  page: php-config84.1
Installing PEAR environment:      /usr/local/php84/lib/php/
[PEAR] Archive_Tar    - already installed: 1.5.0
[PEAR] Console_Getopt - already installed: 1.4.3
[PEAR] Structures_Graph- already installed: 1.2.0
[PEAR] XML_Util       - already installed: 1.4.5
[PEAR] PEAR           - already installed: 1.10.16
Wrote PEAR system config file at: /usr/local/php84/etc/pear.conf
You may want to add: /usr/local/php84/lib/php to your php.ini include_path
Creating symlink /usr/local/php84/bin/php84 -> /usr/local/php84/bin/php
Creating symlink /usr/local/php84/bin/lsphp84 -> /usr/local/php84/bin/lsphp
Creating symlink /usr/local/php84/bin/php-cgi84 -> /usr/local/php84/bin/php-cgi
Creating symlink /usr/local/php84/bin/php-config84 -> /usr/local/php84/bin/php-config
Creating symlink /usr/local/php84/bin/phpize84 -> /usr/local/php84/bin/phpize
Creating symlink /usr/local/php84/sbin/php-fpm84 -> /usr/local/php84/sbin/php-fpm
compiling bz2 for PHP 8.4...
download_cached: using cached '/usr/local/directadmin/custombuild/cache/php-8.4.6.tar.gz' file

the PHP version did not upgrade:

Bash:
-rwxr-xr-x 1 root root 27297280 Mar 16 08:29 lsphp
lrwxrwxrwx 1 root root       26 Apr 24 08:31 lsphp84 -> /usr/local/php84/bin/lsphp
-rwxr-xr-x 1 root root      847 Jan 28 13:11 pear
-rwxr-xr-x 1 root root      868 Jan 28 13:11 peardev
-rwxr-xr-x 1 root root      781 Jan 28 13:11 pecl
lrwxrwxrwx 1 root root        9 Mar 16 08:29 phar -> phar.phar
lrwxrwxrwx 1 root root       11 Apr 24 08:31 phar84 -> phar84.phar
-rwxr-xr-x 1 root root    15253 Apr 24 08:31 phar84.phar
-rwxr-xr-x 1 root root    15251 Mar 16 08:29 phar.phar
-rwxr-xr-x 1 root root 27294872 Mar 16 08:29 php
lrwxrwxrwx 1 root root       24 Apr 24 08:31 php84 -> /usr/local/php84/bin/php
-rwxr-xr-x 1 root root 27294536 Mar 16 08:29 php-cgi
lrwxrwxrwx 1 root root       28 Apr 24 08:31 php-cgi84 -> /usr/local/php84/bin/php-cgi
-rwxr-xr-x 1 root root     3649 Mar 16 08:29 php-config
lrwxrwxrwx 1 root root       31 Apr 24 08:31 php-config84 -> /usr/local/php84/bin/php-config
-rwxr-xr-x 1 root root 27294536 Mar 16 08:29 phpdbg
-rwxr-xr-x 1 root root 27294536 Apr 24 08:31 phpdbg84
-rwxr-xr-x 1 root root     4879 Mar 16 08:29 phpize
lrwxrwxrwx 1 root root       27 Apr 24 08:31 phpize84 -> /usr/local/php84/bin/phpize

and the version remained the same:

Bash:
PHP 8.4.5 (cli) (built: Mar 16 2025 08:29:04) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.5, Copyright (c) Zend Technologies
    with the ionCube PHP Loader v14.4.0, Copyright (c) 2002-2025, by ionCube Ltd.
    with Zend OPcache v8.4.6, Copyright (c), by Zend Technologies

See: the Zend OPcache v8.4.6 - UPGRADED, but PHP version never upgraded.
Fixed by renaming
Bash:
mv /usr/local/php84 /usr/local/php84.OLD
and re-installing PHP 8.4

Once PHP 8.4.6 gets installed, it can be recompiled and updated by usual means. I mean that, the commands:

Bash:
mv /usr/local/php84 /usr/local/php84.OLD
da build php 8.4

# ... some time later ...
da build php 8.4

the second attempt will update PHP without an issue.


Probably @fln could advise
 
@zEitEr, would be great to have access to this server to investigate this further.

We rely on PHP make install command to replace the binaries. If there are circumstances when the binaries would not be replaced it would be good to track it down and fix it. Our long term goal is to make PHP to completely replace whole /usr/local/php{nn} directory, but we have not reached it yet. Right now new PHP files are being merged over the old ones.
 
would be great to have access to this server to investigate this further.

The PHP version was already upgraded, so I can not say whether or not it can be replicated. I will update the thread or a ticket if it can be reproduced.
 
Back
Top