0

I need some help trouble shooting Drush. I'm on a shared server, Hostgator, running Linux and PHP 5.6.3.

My install looks something like home/public_html/websites/MyDrupal

I have installed Composer globally as well as Drush .bashrc includes:

# .bashrc
export PATH=$PATH:~/.composer/vendor/drush/drush
[ -z "$PS1" ] && return

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
alias composer="/usr/bin/php-cli ~/bin/composer.phar"
alias drush="~/.composer/vendor/drush/drush/drush"

Composer runs from any directory within my host space.

Drush will run, using the directory hierarchy example above, from 'home', 'public_html' and 'websites' but if I run drush status within 'MyDrupal' I get an error:

Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: syntax error, unexpected 'finally' (T_STRING), expecting catch
(T_CATCH) in
/.../public_html/bhsu/vendor/symfony/dependency-injection/ContainerBuilder.php,
line 452

Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /.../public_html/bhsu/vendor/symfony/dependency-injection/ContainerBuilder.php on line 452

Would appreciate pointers... thanks

  • So, the problem only occurs when Drush actually finds/uses Drupal. I'm guessing there is an conflict. Maybe your Drush doesn't support the version of Drupal you have? Which versions exactly do you have (of Drush and Drupal)? Do you have a site local Drush too? – hansfn Dec 7 '17 at 9:12
0

Fixed: we figured out that composer and drush were using an older version of PHP which wouldn't work w/ Drupal 8. I still don't understand how the webserver can run one version (phpinfo.php showed the site running the expected 5.6 version) while Drush is set to another. Anyway, finding and aliasing to the proper version fixed the issue. The fix was adding this to .bashrc: (your path might be different). alias php='/opt/php56/bin/php' alias composer='/opt/php56/bin/php ~/bin/composer' export DRUSH_PHP='/opt/php56/bin/php'

  • I still don't understand how the webserver can run one version (phpinfo.php showed the site running the expected 5.6 version) while Drush is set to another. it’s very common, one version for cli, a different version for fpm/etc. Shared hosts often let you pick from a number of different php versions installed on the same box; people often forget/don’t know to update config for everything they’re going to use – Clive Dec 8 '17 at 17:04

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.