Skip to content

Find a way to install PHP imagick which doesn't seg fault in PHP 7.0 and 7.1. #7

Closed

Description

@gitlost

See #5 (comment).

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.

Activity

  1. schlessera commented on Apr 7, 2017

    @schlessera
    Member

    Current state: Installing imagick is only installed on PHP 5.6.
    https://github.com/wp-cli/media-command/blob/master/.travis.yml#L38

  2. gitlost commented on Apr 8, 2017

    @gitlost
    ContributorAuthor

    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.

    (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).

  3. gitlost commented on May 29, 2017

    @gitlost
    ContributorAuthor

    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.

  4. gitlost commented on Jun 27, 2017

    @gitlost
    ContributorAuthor
  5. added this to the 1.0.4 milestone on Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions