0

I have a CentOS 6 server with WHM/cPanel. I installed a global Drush as root using the instructions here (http://docs.drush.org/en/master/install/). Drush works fine for any user I ssh in as. However I typically ssh in as my user and then sudo su to the user I'm working on. When I do that I get these errors. If I ssh in as that user directly drush works fine. How can I make drush work when I su to a different user?

PHP Warning:  proc_open(): Descriptor item must be either an array or a File-Handle in phar:///usr/local/bin/drush/includes/startup.inc on line 366
Content-type: text/html; charset=UTF-8

<br />
<b>Warning</b>:  proc_open(): Descriptor item must be either an array or a File-Handle in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>366</b><br />
PHP Warning:  proc_get_status() expects parameter 1 to be resource, boolean given in phar:///usr/local/bin/drush/includes/startup.inc on line 367
<br />
<b>Warning</b>:  proc_get_status() expects parameter 1 to be resource, boolean given in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>367</b><br />
PHP Warning:  proc_close() expects parameter 1 to be resource, boolean given in phar:///usr/local/bin/drush/includes/startup.inc on line 368
<br />
<b>Warning</b>:  proc_close() expects parameter 1 to be resource, boolean given in <b>phar:///usr/local/bin/drush/includes/startup.inc</b> on line <b>368</b><br />

EDIT

So I got it to work. If I do sudo su - newuser instead of sudo su newuser it works.

I think it's related to CLI/CGI. PHP runs as CLI when I su with the - and CGI when I su without the -. Can anyone explain the difference the - makes?

  • Somebody please answer i too am getting this error. – neha Aug 27 '16 at 15:29
0

Found the answer here: https://superuser.com/questions/453988/whats-the-difference-between-su-with-and-without-hyphen

The difference between "-" and "no hyphen" is that the latter keeps your existing environment (variables, etc); the former creates a new environment (with the settings of the actual user, not your own).

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.