MyTetra Share
Делитесь знаниями!
PHP 7 - Installing imagick on Ubuntu 14.04
Время создания: 13.07.2018 15:30
Автор: https://gist.github.com/nivv
Текстовые метки: php php7 imagick ubuntu 14.04
Раздел: PHP

Guide


Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions


I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating


Install dependencies

$ sudo apt-get install php7.0-dev

$ sudo apt-get install pkg-config

$ sudo apt-get install libmagickwand-dev

$ sudo apt-get install imagemagick

$ sudp apt-get install build-essential


# Or

$ sudo apt-get install -y php7.0-dev pkg-config libmagickwand-dev imagemagick build-essential


Download extension


Mikko Koppanen have a PHP 7 compatible build of imagick. Be sure to download the phpseven branch (We're doing that below). I suppose you could clone the repo if you want the latest changes available more easily


I usually create a download directory for temporary downloads


mkdir downloads

$ cd downloads

$ wget https://github.com/mkoppanen/imagick/archive/phpseven.zip

Unzip it:

$ unzip phpseven.zip

Cd into it

$ cd imagick-phpseven

Make extension

Phpize it

$ phpize

Configure it and run make

$ ./configure

$ make

$ sudo make install

Tell PHP about the extension (Modified steps from Fideloper's guide for sphinx)

$ echo "extension=imagick.so" | sudo tee /etc/php/mods-available/imagick.ini


# Symlink it to fpm

$ sudo ln -s /etc/php/mods-available/imagick.ini /etc/php/7.0/fpm/conf.d/20-imagick.ini


# Symlink it to cli

$ sudo ln -s /etc/php/mods-available/imagick.ini /etc/php/7.0/cli/conf.d/20-imagick.ini


# Reload php-fpm

sudo service php7.0-fpm reload

Done!

 
MyTetra Share v.0.53
Яндекс индекс цитирования