Skip to content

The GD extension of PHP older than 7.4 cannot be compiled on Ubuntu 19.04 #1033

@morozov

Description

@morozov
$ phpbrew --debug install 7.3.7 +neutral +gd                                             9.4s
===> phpbrew will now build 7.3.7
---> Parsing variants from command arguments '+neutral +gd'
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c3608fa7114642725854119ccffe722f42fc7c31e5e4c00d5cb4cb1a0d16bf18
===> Distribution file was successfully extracted, skipping...
Source Directory: /home/morozov/.phpbrew/build/php-7.3.7
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/home/morozov/.phpbrew/build/php-7.3.7' --quiet 'clean'
Running Command:/usr/bin/make -C '/home/morozov/.phpbrew/build/php-7.3.7' --quiet 'clean'
Writing variant info to /home/morozov/.phpbrew/php/php-7.3.7/phpbrew.variants
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Enabled variants: [gd, xml, opcache]
Disabled variants: []
===> Configuring 7.3.7...


Use tail command to see what's going on:
   $ tail -F /home/morozov/.phpbrew/build/php-7.3.7/build.log


./configure '--cache-file=/home/morozov/.phpbrew/cache/config.cache' '--prefix=/home/morozov/.phpbrew/php/php-7.3.7' '--with-config-file-path=/home/morozov/.phpbrew/php/php-7.3.7/etc' '--with-config-file-scan-dir=/home/morozov/.phpbrew/php/php-7.3.7/var/db' '--with-gd=shared' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--enable-opcache' >> /home/morozov/.phpbrew/build/php-7.3.7/build.log 2>&1
Error: Configure failed:
The last 5 lines in the log file:
If configure fails try --with-webp-dir=<DIR>

checking for jpeg_read_header in -ljpeg... yes

checking for png_write_image in -lpng... yes

If configure fails try --with-xpm-dir=<DIR>

configure: error: freetype-config not found.

Please checkout the build log file for more details:
	 tail /home/morozov/.phpbrew/build/php-7.3.7/build.log

The reason is Debian Bug #871470:

The `freetype-config' script is no longer installed by default
(Closes: #871470, #886461). All packages depending on libfreetype6-dev should use pkg-config to find the relevant CFLAGS and libraries.

This problem is fixed in PHP 7.4 (php/php-src#3632) but the older versions need to be patched (see freetype.patch from Archlinux).

Also, there's a file named 0047-Use-pkg-config-for-FreeType2-detection.patch in Ondřej Surý's builds for PHP which would probably solve the problem as well (not sure how to reference it).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions