How to change PHP Command Line Version (CLI) correctly?

Tumbler

New Member
Joined
Oct 29, 2021
Messages
1
Reaction score
0
Credits
21
Hello everyone,

since a short time I try myself at the adventure to configure a private root server.

But now I stumble upon a strange thing. To install a panel for a Minecraft server (Pterodactyl), I have to install some components. On the whole, this works quite well. As an old "DOSler" I get along amazingly well in the shell. ;)

But now I run into the problem of the Command Line PHP version. It is currently 5.4.16 - so very old. In the meantime I have installed Composer and should update some dependencies. But that doesn't work, because Composer thinks that I have a too old PHP version running in CLI mode. And this is true. So I have to change the PHP CLI version to PHP 8.0.

Since the server runs with Plesk, I have to do it a little bit different than most tutorials explain it. So I took the official Plesk description (here: https://support.plesk.com/hc/e...a-Plesk-for-Linux-server-). Here I chose the "non-chrooted" variant and made the adjustments in .bashrc and .bash_profile - saved and restarted the server.

Now the confusing thing: If I now log in to the shell as root user and use "php -v", PHP 8.0 is displayed. I thought: Great, worked! ;)

BUT: If I now go to the directory of the panel and run "composer update", it hails errors, with the reason that my server uses PHP 5.4.16. So what?

Hm ... do you guys have any idea where I'm wrong?

Cheers
Rusty
 


Hmm...

Ideally, someone else will come along and help you better than I can.

In the meantime, I know it's possible to install multiple versions of PHP on the same system. Perhaps that's the path you should be taking?

I just double checked - I searched for "install multiple versions of php on the same system" and got a ton of results. So, that may be the right path for you.
 

Members online


Latest posts

Top