When trying to run Drush on my shared hosting account I get this error:

Your command line PHP installation is too old. Drush requires at least PHP 5.3.0.
To suppress this check, set the environment variable DRUSH_NO_MIN_PHP=1

When I type php --version, it tells me that I am running PHP 5.2.6.

The .bashrc file has the following lines

export COLUMNS
alias drush='/usr/bin/php ~/public_html/drush/drush.php'
alias php='/usr/bin/php'

How I can fix this?

  • 1
    You need to upgrade php? – Letharion Feb 8 '14 at 23:40
  • does drupal.stackexchange.com/questions/44967/… help? – berliner Feb 9 '14 at 1:35
  • Thanks for the help guys. I have looked at that thread already but the problem I'm having is I don't know the path to newer versions of php. So I'm not sure how to use that export line. Is this something my host provider would have to tell me? – amagneto Feb 9 '14 at 10:20
  • "I don't know the path to newer versions of php." - ask your sysadmin? We can't know that path. Your sysadmin should assist you with that. Unless ot's a really really cheap hosting, then ask on Super User how to find it without help. – Mołot Feb 10 '14 at 8:59

I had a similar problem and I was able to specify what version of PHP Drush will use by adding the following to my .bash_profile file:

export DRUSH_PHP=/usr/local/php53/bin/php

That got mine working. I had tried a more general approach where I specified PHP 5.3 for my command line generally, but this didn't work. Specifically targeting Drush is what it took for me.

| improve this answer | |
  • if it is php 7 add /usr/local/php5-7.0.14-20170114-204712/bin/php or do ls /usr/local/ and find which php is installed and runing on your system. Then add export /usr/local/PHP_your_version/bin/php – user21513 Feb 8 '17 at 11:29

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