You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Find a way to install PHP imagick which doesn't seg fault in PHP 7.0 and 7.1. #7
In order to run media tests involving PDF previews, the PHP extension imagick needs to be installed.
Unfortunately using pecl install of the latest 3.4.3 version under Ubuntu Precise 12.02 can cause it to randomly seg fault when built against PHP 7.0 (or PHP 7.1).
One would hope that there might be some way or combination of systems/versions etc to make it work.
The issue turned out to be the old version of ImageMagick (6.6.9 Q16) that comes with travis not being compatible with PHP 7.x.
If pecl install imagick is built against a modern version of ImageMagick (eg 6.9.8-3, the latest 6.9 version) then the seg faults go away.
Following this stackoverflow post, the newer version of ImageMagick can be built locally, which takes about 7 minutes but can be cached. The pecl install for PHP 7.x is then pointed to this local build.
See gitlost#4 for imagick installed for PHP 7.1, 7.0 and 5.6. A new "bin/install-imagick.sh" script does the install. Also temporarily using gitlost/wp-cli#1 so the @require-wp-4.7.3 tests run.
It could be worth doing this, at least for PHP 7.0.
An update which installs Imagick for all versions of PHP is at gitlost#6 (see also trac #40537 ). PHP 7.1 still managed to seg fault once using the 6.9.7-10 version of ImageMagick that all the others use, but changing this to 7.0.4-10 (the latest "-10" version - "-10" versions seem to be the ones permanently available on the ImageMagick download site) fixed it (so far).
Activity
schlessera commentedon Apr 7, 2017
Current state: Installing
imagickis only installed on PHP 5.6.https://github.com/wp-cli/media-command/blob/master/.travis.yml#L38
gitlost commentedon Apr 8, 2017
The issue turned out to be the old version of ImageMagick (6.6.9 Q16) that comes with travis not being compatible with PHP 7.x.
If
pecl install imagickis built against a modern version of ImageMagick (eg 6.9.8-3, the latest 6.9 version) then the seg faults go away.Following this stackoverflow post, the newer version of ImageMagick can be built locally, which takes about 7 minutes but can be cached. The
pecl installfor PHP 7.x is then pointed to this local build.See gitlost#4 for imagick installed for PHP 7.1, 7.0 and 5.6. A new "bin/install-imagick.sh" script does the install. Also temporarily using gitlost/wp-cli#1 so the
@require-wp-4.7.3tests run.It could be worth doing this, at least for PHP 7.0.
(Just on the current ".travis.yml" I think the cache syntax https://github.com/wp-cli/media-command/blob/master/.travis.yml#L16 for caching "$HOME/.composer/.cache" needs to be in a "directories" list like https://github.com/gitlost/media-command/blob/imagick/.travis.yml#L16).
gitlost commentedon May 29, 2017
An update which installs Imagick for all versions of PHP is at gitlost#6 (see also trac #40537 ). PHP 7.1 still managed to seg fault once using the 6.9.7-10 version of ImageMagick that all the others use, but changing this to 7.0.4-10 (the latest "-10" version - "-10" versions seem to be the ones permanently available on the ImageMagick download site) fixed it (so far).
I think this is worth doing so I'll open a PR.
gitlost commentedon Jun 27, 2017
Still happening for PHP 7.1 - https://travis-ci.org/wp-cli/media-command/jobs/247163842 from #21