-2

After installing drupal 8 on a remote server (I have SSH access) using composer I installed drush using the following command: 'composer require drush/drush'. After I type vendor/bin/drush I get the following error:

[preflight] The following restricted PHP modes have non-empty values: {disable_functions}. This configuration is incompatible with drush. {Please check your configuration settings in /usr/local/lib/php.ini or in your drush.ini file; see examples/example.drush.ini for details.}

My drush version is 9.6. How do I make it work?

  • The error message tells you what todo... – No Sssweat Jun 1 at 11:26
  • I'm new to linux, therefore I seeked help. Error message tells me to check my configuration settings for compatibility with drush - I don't know what needs to be done to make them compatible (empty some values, what values?). And there is no example.drush.ini file in my vendor/drush/drush/examples folder. – Tommy Jun 1 at 11:50
0

It turns out that making it work wasn't at all easy, so I'll try to post an answer to my own question in the hope that it helps some other newbies, who do not have a lot of experience in working with remote linux servers, but want to use drush 9.x with their Drupal 8 installation:

  1. First of all, after finding a similar problem in https://www.drupal.org/forum/support/post-installation/2015-08-02/solved-installed-drush-not-working-warning-popen-disabled (this quite long collection of posts is, I believe, worth reading) I found out that you have to give Drush its own php.ini file with looser security. One way to do it is described in here: http://www.6by9.net/drush-on-an-hosting-fix-using-custom-php-ini/
  2. Sadly, the above doesn't work for drush 9.x, so after another search I chanced upon the following https://github.com/drush-ops/drush/issues/3294#issuecomment-370201342 In this comment Moshe Weitzman writes that you have to

insure that the PHPRC environment variable is set to the directory containing the desired php.ini

  1. So after another search I managed to find out how to do it using the following command:

export PHPRC=/your/path

and in my particular case it looked like this:

export PHPRC=~/.drush

I don't know if it is the 'right' way to do it, but it works :-)

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.