I registered Bluehost, because they are recommended by drupal and because I wanted shell access for drush. I tried to install drush, but got some problems. Bluehostforum.com doesn't seem to be online anymore, that's why I'm asking here.

First I had to contact the support to enable the shell access and they did it. Composer was already installed. Then I tried

composer require drush/drush

and got this error message:

The "https://packagist.org/packages.json" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0 failed to open stream: no suitable wrapper could be found)  

The used php.ini was somewhere in /opt/cpanel/... and read only. I set PHPRC to use the php.ini in my home directory:

php -i | grep php.ini
export PHPRC=/home/mydir/php.ini

Now there were extensions missing ('undefined function ...') which I added in php.ini:

allow_url_fopen = On
extension = phar.so
extension = json.so
extension = tokenizer.so
extension = ctype.so
extension = iconv.so
extension = simplexml.so

Finally drush was working. Is there a better way to do this? I.e. to add all the extensions in one step?

Thank you very much!


I found a much simpler and working solution with composer at this links:



There was an older composer already installed and read only, so I downloaded a newer one and created an alias in .bashrc:

# curl -sS https://getcomposer.org/installer | php
# mv composer.phar ~/bin/composer.phar
# alias composer="php ~/bin/composer.phar"
# composer -V 
# composer diagnose
# composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
  • This worked so darn well. I spent an hour with tech support at BH and finally found this. Thank you. – atwixtor Aug 29 '18 at 5:58
  • Damn dude. Thanks! – fischgeek Apr 2 '19 at 3:04

You can install drush via Homebrew

When you you have Homebrew installed you shall prepare for drush by running

brew install git and brew update After that you can just type

brew tap homebrew/dupes

brew tap homebrew/versions

brew tap homebrew/php

brew install drush

  • Thank you. I installed linuxbrew and then used your commands. But when installing drush I get this "Error: Permission denied - /usr/bin/gcc". – Jan F. Sep 18 '17 at 14:26
  • Have you tried run command as superuser sudo? – user72672 Sep 18 '17 at 14:32
  • With sudo I get "sudo: effective uid is not 0, is sudo installed setuid root?". – Jan F. Sep 18 '17 at 14:36
  • What to you get if you type brew --version – user72672 Sep 18 '17 at 14:38
  • Try run chmod u+s /usr/bin/sudo as root, and try install drush again – user72672 Sep 18 '17 at 14:42

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