Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php7: does not require libgd to build with freetype support #10944

Closed
flyn-org opened this issue Jan 4, 2020 · 4 comments
Closed

php7: does not require libgd to build with freetype support #10944

flyn-org opened this issue Jan 4, 2020 · 4 comments
Assignees

Comments

@flyn-org
Copy link
Contributor

flyn-org commented Jan 4, 2020

Maintainer: @mhei
Environment: x86_64 master

Description:
Commit 0f10c8c caused php7-mod-gd to build against the external libgd library. However, the libgd library does not build by default with freetype support. This leaves php7-mod-gd lacking symbols---such as gdFontCacheShutdown---needed by many PHP programs. Here is an example:

# php-cli occ upgrade
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/gd.so (Error relocating /usr/lib/php/gd.so: gdFontCacheShutdown: symbol not found), /usr/lib/php/gd.so.so (Error loading shared library /usr/lib/php/gd.so.so: No such file or directory)) in Unknown on line 0
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
PHP module GD not installed.
Please ask your server administrator to install the module.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /mnt/xvdb/var/www/flyn.org/share-new/lib/private/Console/Application.php:167
Stack trace:
#0 /mnt/xvdb/var/www/flyn.org/share-new/console.php(98): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /mnt/xvdb/var/www/flyn.org/share-new/occ(11): require_once('/mnt/xvdb/var/w...')

Is it possible that php7-mod-gd could require that libgd build with freetype support? Or, perhaps libgd should build with freetype support by default. Note that I have filled a separate pull #10943 which describes why building libgd with freetype presently appears broken.

@mhei mhei self-assigned this Jan 5, 2020
@mhei
Copy link
Member

mhei commented Jan 5, 2020

I stumbled over this problem a few days ago, too. But due to xmas holidays, I did not found enough time to dig into this.
Points I would like to clarify would be e.g.:

  • is it possible for libgd client to detect whether libgd is compiled with freetype support?
  • if so, does the php gd extension makes use of such a feature?
  • beside the points above, I agree that a users of php-mod-gd probably almost want to have freetype support and do not really care about package size etc. but if we declare a dependency to libgd's freetype support, then the buildbots would build it always with it enabled which might conflict with other libgd users (I did not check libgd for other users though)

@flyn-org
Copy link
Contributor Author

flyn-org commented Jan 5, 2020

From what I can tell so far, PHP does not try to determine whether libgd provides freetype support. I was a little surprised that PHP built without it, but I suppose that is because the output of the PHP build is gd.so, a shared object. The linker will not complain about gd.so's unresolved symbols.

The following packages seem to depend (sometimes optionally) on libgd:

multimedia/fswebcam
libs/serdisplib
lang/php7
net/vnstat
net/apcupsd
net/nut
utils/bandwidthd
utils/lcd4linux

My first instinct is to bite the bullet and build freetype support into libgd by default.

We could patch PHP to pull out the font stuff from the gd module, but that would probably surprise someone who runs a PHP application that requires it.

What about modifying libgd to follow the vim package's vim and vim-full model? I think ffmpeg/libffmpeg might do this too. It looks like the build system builds all of the variants in these cases.

@flyn-org
Copy link
Contributor Author

flyn-org commented Jan 5, 2020

@jow-, any comments?

flyn-org added a commit to flyn-org/packages that referenced this issue Jan 9, 2020
The php7-mod-gd package requires that freetype support exist in libgd,
but this is not included in the default libgd build. In order to allow
a working php7-mod-gd package while keeping the default libgd package
as small as possible, this commit introduces a -full variant of the
libgd package.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
flyn-org added a commit to flyn-org/packages that referenced this issue Jan 9, 2020
The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only if
explicitly configured.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
flyn-org added a commit to flyn-org/packages that referenced this issue Jan 9, 2020
The php7-mod-gd package requires that freetype support exist in libgd,
but this is not included in the default libgd build. In order to allow
a working php7-mod-gd package while keeping the default libgd package
as small as possible, this commit introduces a -full variant of the
libgd package.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
flyn-org added a commit to flyn-org/packages that referenced this issue Jan 9, 2020
The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only
if explicitly configured.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
mhei pushed a commit that referenced this issue Jan 12, 2020
The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only
if explicitly configured.

Ref: #10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
@mhei
Copy link
Member

mhei commented Jan 12, 2020

Fixed with fa0d982

@mhei mhei closed this as completed Jan 12, 2020
paper42 pushed a commit to paper42/packages that referenced this issue Jun 21, 2022
The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only
if explicitly configured.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
paper42 pushed a commit to paper42/packages that referenced this issue Jun 21, 2022
The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only
if explicitly configured.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
paper42 pushed a commit to paper42/packages that referenced this issue Jun 23, 2022
php7: major upgrade to 7.4.1

- remove obsolete patches and update other ones
- filter support is now available as an extension module
- php7-mod-hash: this extension is now part of the core binary
  and cannot be built as an extension module anymore
- php7-mod-gd:
  - do not use bundled libgd, but rely on external one
  - this also obsoletes dependencies and configuration options
- php7-mod-zip: requires external libzip now

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update the gd module to depend on libgd-full

The php7-mod-gd package requires that freetype support exist in libgd. The
libgd-full package provides this, whereas the libgd package does only
if explicitly configured.

Ref: openwrt#10944
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.2

This fixes:
  - CVE-2020-7059
  - CVE-2020-7060

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: fix dependencies for mysqlnd (fixes openwrt#11113)

When during the build the openssl extension is also selected, then
the mysqlnd extension depends on it, too.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.3

This fixes:
  - CVE-2020-7061
  - CVE-2020-7062
  - CVE-2020-7063

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.4

This fixes:
  - CVE-2020-7064
  - CVE-2020-7065
  - CVE-2020-7066

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.5

This fixes:
  - CVE-2020-7067

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.6

This fixes:
  - CVE-2019-11048

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.7

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.8

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.9

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.10

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.11

This fixes:
  - CVE-2020-7069
  - CVE-2020-7070

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.12

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: fix for icu 68.1

openwrt#13883
php/php-src@8eaaabd

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>

php7: update to 7.4.13

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: remove obsolete patch for ICU 68.1

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: add CI test script

This adds basic checks for php7 core and module packages.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: fix some whitespace nitpicks

Align some lines with the rest, no functional change.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.14

This fixes:
    - CVE-2020-7071

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

lang/php7: Don't run phpize7 with QUILT

Allows targets such as prepare, refresh, or update to be run without
building dependencies for easier patch maintenance.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>

php7: update to 7.4.15

This fixes:
    - CVE-2021-21702

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: fix pecl build with QUILT

Commit d741a64 ("lang/php7: Don't run phpize7 with QUILT") changed
pecl.mk to not run phpize7 during Package/prepare if QUILT is set.  The
intention was to allow prepare, refresh and update targets to run
without building dependencies.

As a side-effect, Package/configure and Package/compile fail when QUILT
is defined because they can't find ./configure or a Makefile.  It also
impacts the github tests run with pull requests, because QUILT is
defined there.

To avoid that failure and still keep the prepare, refresh, and update
speedup, call phpize7 before Package/Configure if QUILT is defined.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 3476816)

php7: fix build with QUILT

When building with QUILT, unlike the regular build, Build/Prepare does
not apply the patches.  So when buildconf is called with QUILT on, at
the end of Build/Prepare, it will not have the patched sources, and
build will fail.

To fix the problem, run buildconf in Build/Prepare only when QUILT is
off, and do it in Build/Configure otherwise.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit d4979cf)

php7: update to 7.4.16

Also refresh patch.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit 87e852f)

php7: update to 7.4.18

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit aaaeef8)

php7: update to 7.4.19

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit 4e39d9f)

php7: update to 7.4.22

This fixes:
    - CVE-2021-21704
    - CVE-2021-21705

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

(cherry picked from commits
  - 555d0c9
  - f15aba8
  - 741d6d6)

php7: update to 7.4.23

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit fb9e056)

php7: fix config file upgrade issue (fixes openwrt#14623)

The addressed issue is related to openwrt#6893 as its resolution
is actually causing the problem.

When changing the priority of the config file it happens
that after a sysupgrade the previous file is restored
and the new file is added, ending up in a situation
like this:

/etc/php7/15_openssl.ini
/etc/php7/20_openssl.ini

Causing a double extension=openssl.so to be parsed,
which is not appropriate and leads to error message.

The same problem might also occur for mysqli since there
was also a priority change - let's take care about this
at the same time.

The solution is to remove one of the files. Since it is
a configuration file, the user might have adjusted it, so
lets just use the previous version to replace the new
installed version.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit e51a049)

php7: fix module loading with glibc (refs openwrt#16642)

Without -ldl linker flag .so extensions are not loaded
when glibc is used. Fix it by providing adjusted LDFLAGS
for this case.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit d153c61)

php7: update to 7.4.24

This fixes:
    - CVE-2021-21706

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit 96a04ad)

php7: update to 7.4.25

This fixes:
    - CVE-2021-21703

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit 1df333b)

php7: Support for icu 70.1

This PR prepares PHP for a few minor changes that cause PHP builds to fail when using --enable-intl with ICU 70.1.

Change UBool to bool for equality operators in ICU >= 70.1

php/php-src#7596

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit bc13112)

php7: Clean up and update distributed php.ini for php 7.4.25

Details:
- Cleaned up whitespace and removed comments (refer to official PHP documentation for that)
- Removed directives that no longer exist as of PHP 7.4.25
- Added '~E_DEPRECATED' to 'error_reporting'

Directives removed that no longer exist as of PHP 7.4.25:
- zend.ze1_compatibility_mode
- y2k_compliance
- register_globals
- register_long_arrays
- magic_quotes_gpc
- magic_quotes_runtime
- magic_quotes_sybase
- always_populate_raw_post_data

Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net>

php7: update to 7.4.26

This fixes:
    - CVE-2021-21707

Also drop upstream patch which is included in the release now.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit c6f2767)

php7: update to 7.4.27

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: update to 7.4.28

This fixes:
    - CVE-2021-21708

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

php7: fix dep on libgd

php7: refresh patches

php7: update to 7.4.30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants