After upgrading one server to EA4 I've noticed a problem with drush. It won't work on my cPanel easy apache 4 server but will work fine on any other cPanel server running the same versions of everything except with EA3. I cannot figure out why.
I had drush installed prior to the update. I also have drush installed on other cPanel servers with the same version of cpanel/PHP etc. but with easyapache3
Drush works fine on my other identical servers (only difference being easyapache 3 vs 4)
On the EA4 server:
Running "drush" command as root just gives no output other than this:
Content-type: text/html; charset=UTF-8
Su'ing to a user and running drush results in:
PHP Warning: array_shift() expects parameter 1 to be array, null given in phar:///usr/local/bin/drush/includes/startup.inc on line 171
PHP Warning: Invalid argument supplied for foreach() in phar:///usr/local/bin/drush/includes/startup.inc on line 182
PHP Warning: pcntl_exec() expects parameter 2 to be array, null given in phar:///usr/local/bin/drush/includes/startup.inc on line 355
PHP Warning: fwrite() expects parameter 1 to be resource, string given in phar:///usr/local/bin/drush/includes/startup.inc on line 359
PHP Warning: fwrite() expects parameter 1 to be resource, string given in phar:///usr/local/bin/drush/includes/startup.inc on line 360
Content-type: text/html; charset=UTF-8
The install instructions for drush say to do this:
php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush
on the EA4 server this results in error:
Error in argument 1, char 2: option not found r
This is because the PHP command is missing the -r flag, while on other cpanel servers with exact same php build has -R option. It does the same using php-cli as well since php-cli is simply a symlink to the same php binary.
So it appears to me that you cannot install drush this way on a cPanel server running easyapache 4, and even if you copy the binary from a working server it does not work on the easyapache4 server.
I had drush installed prior to the update. I also have drush installed on other cPanel servers with the same version of cpanel/PHP etc. but with easyapache3
Drush works fine on my other identical servers (only difference being easyapache 3 vs 4)
On the EA4 server:
Running "drush" command as root just gives no output other than this:
Content-type: text/html; charset=UTF-8
Su'ing to a user and running drush results in:
PHP Warning: array_shift() expects parameter 1 to be array, null given in phar:///usr/local/bin/drush/includes/startup.inc on line 171
PHP Warning: Invalid argument supplied for foreach() in phar:///usr/local/bin/drush/includes/startup.inc on line 182
PHP Warning: pcntl_exec() expects parameter 2 to be array, null given in phar:///usr/local/bin/drush/includes/startup.inc on line 355
PHP Warning: fwrite() expects parameter 1 to be resource, string given in phar:///usr/local/bin/drush/includes/startup.inc on line 359
PHP Warning: fwrite() expects parameter 1 to be resource, string given in phar:///usr/local/bin/drush/includes/startup.inc on line 360
Content-type: text/html; charset=UTF-8
The install instructions for drush say to do this:
php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush
on the EA4 server this results in error:
Error in argument 1, char 2: option not found r
This is because the PHP command is missing the -r flag, while on other cpanel servers with exact same php build has -R option. It does the same using php-cli as well since php-cli is simply a symlink to the same php binary.
So it appears to me that you cannot install drush this way on a cPanel server running easyapache 4, and even if you copy the binary from a working server it does not work on the easyapache4 server.