Welcome back! Many of you are wondering how to change PHP CLI version. In this short article, we will be looking at this.
First, let’s check the current version of PHP. Type in the command:
As you can see, I am currently running PHP v7.4.25.
Change PHP CLI Version
Now let’s change our PHP version but first of we need to know what other versions we can use. To know that type in the terminal:
We have four versions available i.e PHP 7.2, 7.3 7.4, and 8.0. I will be changing it to 8.0.
Now to do that, you need to copy the binary of the version you want to use to the user’s binary. Now type in the following command:
cp /usr/local/lsws/lsphp80/bin/php /usr/bin/
Change the lsphp80 to any version you want and hit enter. After that, check the PHP version again and you’ll see the version is changed.
Read our other articles;
Read More: How to Change Upload limit On CyberPanel?
You can follow us on Facebook too.