Skip to main content

Jan

How to specify command line command "php" version for SSH user on the Plesk server?

1 min read

Take a look at: https://support.plesk.com/hc/en-us/articles/115003766853-How-to-specify-PHP-version-for-command-line...

 

I had to add PATH to .bash_profile file

1. Connect via SSH with the system user to the server

2. Add the PHP path toe .bash_profile file

echo "PATH=/opt/plesk/php/7.3/bin:$PATH" >> ~/.bash_profile

3. Reconnect SSH Connection

 

How to add and remove programs to a chrooted shell environment template

Look at: https://support.plesk.com/hc/en-us/articles/213909545

The above adds the OS version of PHP to the chroot environment, not the PHP executables that are used for the websites.

I therefore replaced

./update_chroot.sh --add php

with

./update_chroot.sh --add /opt/plesk/php/7.1/bin/php

You may want to repeat that with other available php versions.

For convenience I also linked that php binary to usr/bin:

ln -s /opt/plesk/php/7.1/bin/php /var/www/vhosts/chroot/usr/bin/php

Afterwards, of course, do a ./update_chroot.sh --apply <domain>|all