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?