The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Easyapache 4 broke Drush

Discussion in 'EasyApache' started by jfall123, Aug 24, 2016.

  1. jfall123

    jfall123 Well-Known Member

    Joined:
    Oct 31, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    509
    Likes Received:
    64
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    We made a change that brings EA3 compatibility back in EA4, but we haven't yet added '/usr/local/bin/php' to point to php-cli yet. Can you test to see if this works by calling the PHP binary directly, without the wrapper?

    /opt/cpanel/ea-php##/root/usr/bin/php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush


    Could you let me know if that works? We hope to have a fix in place early next week to add the missing binary.

    I hope this helps!
     
  3. jfall123

    jfall123 Well-Known Member

    Joined:
    Oct 31, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6

    The command executes without errors but writes a 0 byte drush file.

    I do seem to be able to run the drush command however using:

    /opt/cpanel/ea-php56/root/usr/bin/php /usr/local/bin/drush

    Doing so does display the regular drush output as expected
     
  4. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    509
    Likes Received:
    64
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Cool, that verifies the issue. We'll have this fixed ASAP. We're looking at case EA-5106.

    Thanks!
     
  5. jfall123

    jfall123 Well-Known Member

    Joined:
    Oct 31, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for the quick reply. For now I believe it should work if I alias drush to use that php binary in bashrc

    alias drush='/opt/cpanel/ea-php56/root/usr/bin/php /usr/local/bin/drush'
     
Loading...

Share This Page