I'm running a server on centos 6.8, and running a magento 2 site on this. The default version of php is 5.3.3, however the site itself is running on 5.6.5.

The latest upgrade to magento2 requires the imagick extension installed and included in php.ini, so i attempted sudo pecl install imagick which returns requires 5.4.0 and greater.

Is there a way to run this command and specify what version of php I wish to use?


Probably you installed php 5.6.5 from a third party repository. If you are lucky this repository might contains imagick binaries.

Try this

yum search imagick

and install the package if it is available with

yum install package-name
  • I need it to be available to add to php.ini – ol'bob dole Nov 23 '16 at 15:21
  • if php 5.6.5 is installed through package manager (yum) and you also install imagick from the same repository then yum will do this automatically. – Vikelidis Kostas Nov 23 '16 at 15:24
  • I already have done this via yum (a few days ago), and as mentioned it hasn't updated the php.ini. I've restarted the server since then, and the issue persists. – ol'bob dole Nov 23 '16 at 15:33
  • OK let's do something else. Please provide the result of the following commands: rpm -qa |grep php5 and then use repoquery -i package-name to detect from which repositories comes the installed php. – Vikelidis Kostas Nov 23 '16 at 15:40
  • The repo for more-php56-php-mcrypt-5.6.5-2.el6.x86_64 (one of the returned packages) was remi-php56more-epel-6-x86_64 – ol'bob dole Nov 23 '16 at 15:46

Below works for me. In my case is php70.

cd ~
export PATH=/usr/local/php70/bin:$PATH
. ~/.bash_profile

Check again with command 'php -v'. Refer here for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.