• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How Install Drush (Drupal Shell) on Plesk 12.5.x

9musashi

Basic Pleskian
Hello, I'm just sign up with Plesk after impress with the neat and clean panel, and especially nginx standalone feature on this panel. I have problem with Drush (Drupal Shell) 8 installation folowing this guide http://docs.drush.org/en/master/install/

Code:
# php drush.phar core-status
PHP Parse error:  syntax error, unexpected '[' in phar:///root/temp/drush.phar/includes/startup.inc on line 63
I suspect Drush required minimum PHP CLI ver 5.4.5 or newer. How do I upgrade PHP CLI from 5.3 (very old) to newer version without breaking Plesk itself ?

Thank you
 
I reccomend to use this trick, just change the path in .bash_profile to: PATH=/opt/plesk/php/5.6/bin:$PATH:$HOME/bin
Bash, serching for the executable php, will find it in /opt/plesk/php/5.6/bin and will execute Drush using the latest supported php version.
Php will get all the configuration data in php.ini from /opt/plesk/php/5.6/etc/php.ini
 
Hi Oto, I already figure it out. Just rename old php
Code:
mv /usr/bin/php /usr/bin/php53

And create new symlink to php 5.4
Code:
ln -s /opt/plesk/php/5.4/bin/php /usr/bin/php

But I dont know if it safe to do that ?
 
I don't think so. Your system should work with 5.3 'cause that version is what other applications are expecting.
You can also upgrade system php activating other repository like EPEL or Atomic.
As usual there are many way to make Drush work, but I'd prefer the one that change as little as possible the base system and Plesk itself.
 
I tried your solution, add this line at ~/.bash_profile
Code:
PATH=/opt/plesk/php/5.6/bin:$PATH:$HOME/bin
But its not working
Code:
# drush init
PHP Parse error:  syntax error, unexpected '[' in phar:///usr/local/bin/drush/includes/startup.inc on line 63
 
That's strange.

Have you restarted the Bash session? (Just log out and log in again)
Please check the php version: php -v
Have you set drush.phar as executable? (chmod +x drush.phar)
Have you initiated Drush? (drush init)

LMK
 
Hi Oto, I retried your suggestion with ~/.bash_profile because I realized I forgot to logout and login SSH. And after retried your previous suggestion, Drush is works now. I decide to follow your trick instead of my symlink way. Thanks Oto.
 
Back
Top