-1

What is the correct way to install and enable PHP Extensions in a Bitbucket Pipeline?


Our bitbucket-pipelines.yml uses image: composer:2.0 which worked fine until a unit test was added that requires php-gd.

gd requires zlib, but installing zlib appears to run phpize from the wrong location giving us the error:

Executing busybox-1.32.1-r6.trigger
OK: 336 MiB in 92 packages
Cannot find config.m4. 
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

Full error for install step docker-php-ext-install zlib gd bcmath json.

+ docker-php-ext-install zlib gd bcmath json
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
(1/28) Upgrading musl (1.2.2-r0 -> 1.2.2-r1)
(2/28) Installing m4 (1.4.18-r2)
(3/28) Installing perl (5.32.0-r0)
(4/28) Installing perl-error (0.17029-r1)
(5/28) Installing perl-git (2.30.2-r0)
(6/28) Installing git-perl (2.30.2-r0)
(7/28) Installing autoconf (2.69-r3)
(8/28) Installing pkgconf (1.7.3-r0)
(9/28) Installing dpkg-dev (1.20.6-r0)
(10/28) Installing dpkg (1.20.6-r0)
(11/28) Installing libmagic (5.39-r0)
(12/28) Installing file (5.39-r0)
(13/28) Installing libgcc (10.2.1_pre1-r3)
(14/28) Installing libstdc++ (10.2.1_pre1-r3)
(15/28) Installing binutils (2.35.2-r1)
(16/28) Installing libgomp (10.2.1_pre1-r3)
(17/28) Installing libatomic (10.2.1_pre1-r3)
(18/28) Installing libgphobos (10.2.1_pre1-r3)
(19/28) Installing gmp (6.2.1-r0)
(20/28) Installing isl22 (0.22-r0)
(21/28) Installing mpfr4 (4.1.0-r0)
(22/28) Installing mpc1 (1.2.0-r0)
(23/28) Installing gcc (10.2.1_pre1-r3)
(24/28) Installing musl-dev (1.2.2-r1)
(25/28) Installing libc-dev (0.7.2-r3)
(26/28) Installing g++ (10.2.1_pre1-r3)
(27/28) Installing re2c (1.3-r1)
(28/28) Installing .phpize-deps (20220307.110146)
Executing busybox-1.32.1-r6.trigger
OK: 336 MiB in 92 packages
Cannot find config.m4. 
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
Gavin
  • 2,214
  • 2
  • 18
  • 26

1 Answers1

1

Running phpize requires to be on the top level of an extension source dir (this source dir should contain a file name config.m4 as the error also points.)

Reference : http://php.net/manual/en/install.pecl.phpize.php for more information.

You may want to change the directory in pipeline script.

Oguzhan Aygun
  • 1,314
  • 1
  • 10
  • 24