Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

pecl install fails on PHP 8.3 due to missing files #2025

@sjinks

Description

@sjinks

Frequently asked questions

  • I have read Frequently Asked Questions
  • I have looked at the list of the existing issues (including closed issues) and searched if my issue has been already reported
  • I have tried to resolve the issue myself and will describe what I did in clear and consise manner

Describe the bug

pecl install <package> fails on PHP 8.3.

To Reproduce

On a clean Ubuntu 22.04 install with software-properties-common installed (I used ubuntu:2204 Docker image):

add-apt-repository -y ppa:ondrej/php
apt-get install -y php8.3-dev php8.3-xml
pecl install apcu

This yields:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading apcu-5.1.22.tgz ...
Starting to download apcu-5.1.22.tgz (93,926 bytes)
.....................done: 93,926 bytes
44 source files, building
running: phpize
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
cp: cannot stat 'shtool': No such file or directory
cp: cannot stat 'config.guess': No such file or directory
cp: cannot stat 'config.sub': No such file or directory
cp: cannot stat 'ltmain.sh': No such file or directory
chmod: cannot access '/tmp/pear/temp/apcu/build/shtool': No such file or directory
shtool at '/tmp/pear/temp/apcu/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

ERROR: `phpize' failed

It works fine with php8.2 though.

Your understanding of what is happening

phpize8.3 does this:

+ cd /usr/lib/php/20230831/build
+ cp php.m4 shtool ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 config.guess config.sub ltmain.sh Makefile.global gen_stub.php /tmp/pear/temp/apcu/build

However, shtool, config.guess, config.sub, and ltmain.sh are missing from /usr/lib/php/20230831/build.

I compared this with phpize8.2 and found this:

+ cd /usr/lib/php/20220829/build
+ cp php.m4 /usr/bin/shtool ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 Makefile.global gen_stub.php /tmp/pear/temp/apcu/build
+ cd /usr/share/aclocal
+ cp pkg.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 /tmp/pear/temp/apcu/build
+ cd /usr/share/libtool/build-aux
+ cp config.sub config.guess ltmain.sh /tmp/pear/temp/apcu/build
+ cd /usr/lib/php/20220829/build
+ cp run-tests.php /tmp/pear/temp/apcu/build

That is, config.guess, config.sub, and ltmain.sh are copied from /usr/share/libtool/build-aux, and shtool is copied from /usr/bin, not from /usr/lib/php/20230831/build

My further analysis showed that the php8.2 source has this patch that is missing in php8.3: 0036-In-phpize-also-copy-config.guess-config.sub-ltmain.s.patch. That patch fixes paths of the files in question.

What steps did you take to resolve issue yourself before reporting it here

Analyzed the sources of phpize8.2 and phpize8.3 and checked for patches that alter the original phpize.

To fix the issue for my Docker build, I had to use a workaround:

RUN cp \
    /usr/share/libtool/build-aux/config.sub \
    /usr/share/libtool/build-aux/config.guess \
    /usr/share/libtool/build-aux/ltmain.sh \
    /usr/bin/shtool \
    /usr/lib/php/20230831/build

Related: Automattic/vip-container-images#536

Expected behavior

phpize does not fail.

Distribution (please complete the following information):

  • OS: Ubuntu 22.04
  • Architecture: amd64, arm64
  • Repository: Ubuntu PPA

Package(s) (please complete the following information):

 apt-cache policy php8.3-dev
php8.3-dev:
  Installed: 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1
  Candidate: 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1
  Version table:
 *** 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1 500
        500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions