Today I’m using Laravel to prototype an application.
I have to manage a lot of PHP versions at the same time that’s why I’m using phpbrew which is an awesome piece of software btw.

I compiled recently PHP 7.2.9 and forgot to add the GD library to it.

With phpbrew you can add GD library afterwards with the following command:

phpbrew ext install gd

This command is handy as you don’t need to recompile PHP entirely

It usually works fine but I got this error:

Error: Command failed: phpize

After some researches it seems I had some packages missing:

sudo apt-get install autoconf automake libtool m4

I ran the command to install the packages and install gd again.

$ phpbrew ext install gd
===> Installing gd extension...
Log stored at: /home/user/.phpbrew/build/php-7.2.9/ext/gd/build.log
Changing directory to /home/user/.phpbrew/build/php-7.2.9/ext/gd
===> Phpize...
===> Configuring...
===> Building...
===> Running make all: /usr/bin/make -C '/home/user/.phpbrew/build/php-7.2.9/ext/gd' 'all'  >> '/home/user/.phpbrew/build/php-7.2.9/ext/gd/build.log' 2>&1
===> Installing...
===> Running make install: /usr/bin/make -C '/home/user/.phpbrew/build/php-7.2.9/ext/gd' 'install'  >> '/home/user/.phpbrew/build/php-7.2.9/ext/gd/build.log' 2>&1
===> Extension is installed.
===> Creating config file /home/user/.phpbrew/php/php-7.2.9/var/db/gd.ini.disabled
===> Enabling extension gd
[*] gd extension is enabled.

And that’s it! :smile: