• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Difficulty with php and composer

PeopleInside

Regular Pleskian
I use an open source project than need run on Composer 2, and I have and on PHP 8.0
I run this open source in a subdomain where I set to use the PHP 8.1 as default.

Now I need upgrade this open source with the SSH command composer update
but when I run I get the error I'm running PHP 7.4

Seems Plesk use PHP 7.4 in SSH? How about if I have PHP 8.0 as requirement?
 
You have to use PHP environment from /opt/plesk/php/8.1/bin/php instead of default OS PHP version from /usr/bin/php
 
Thanks, there is a way to use PHP 8.1 when use php command on SSH?
I mean instead of having all times to digit the long string /opt/plesk/php/8.1/bin/php a way to say to the system:

php = /opt/plesk/php/8.1/bin/php ?

Means when digit php and command on SSH the system understand /opt/plesk/php/8.1/bin/php and command?
 
Thanks.
In the guide for chroot

Create a symlink with the relative path:
ln -s /opt/plesk/php/7.4/bin/php /var/www/vhosts/chroot/bin/php

In my case where I want set PHP 8.1 should be:
ln -s /opt/plesk/php/8.7/bin/php /var/www/vhosts/chroot/bin/php or I need keep 7.4 that is the default OS version?

If in the future want revert back how I can do? The guide seems never explain this.
Thank you.
 
Yes Igor, done but PHP still be 7.4 for all users.
Seems I will not resolve this.

It's little bad that Plesk never let user set PHP 8.1 as default also for SSH.
 
I did everything strictly according to the instructions, and in the end I see:

Code:
[root@ppu18-0 ~]# ln -s /opt/plesk/php/8.1/bin/php /var/www/vhosts/chroot/bin/php
[root@ppu18-0 ~]# ./update_chroot.sh --apply all
Applying chrooted environment on resas.st: Done! Action have been completed.
[root@ppu18-0 ~]# su resas.st_eobq33h2iye
bash-4.2$ php -v
PHP 8.1.4 (cli) (built: Mar 18 2022 19:05:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies

So, instruction works fine.
 
I am able to download update_chroot.sh and just run.
Maybe I don't know if I miss some steps. Seems hard to me.

I never get: Applying chrooted environment on resas.st: Done! Action have been completed.
 
Back
Top