PHP Version Anomaly

I'm VERY new to the world of web development but I have an application, written in PHP that is being used by a number of clients with no issues.

A recent new feature requires the use of a third party component and required PHP 8.1 to be installed. All is working fine on my test, localhost system which has PHP 8.2. I've come to deploy the changes live and at a point in the code where the PHP version is checked, I get the following message:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". Installed Version: 7.4.33

Which, of course, suggests that the wrong version of PHP is installed. However, if I log in to cPanel on my website which has a facility called MultiPHP Manager, it reports the following:

website.jpg


It does offer the option to change the version but I've tried setting it 7.3 and then back to 8.2 but it makes no difference.

Any suggestions as to where to look next?

John
 

rsshep

Free Member
Apr 9, 2014
74
8
45
It's been a while since I used cpanel, and I don't do a great deal with PHP these days either, but, I do recall that the PHP version used to serve your website can be different to the version used on the command line, i.e. where composer would be executed.

It might be worth speaking to your hosting company and making the query with them, they may be able to update that for you, or provide you with the full path to PHP 8.2 so you can run composer using that.
 
Upvote 0

fisicx

Moderator
Sep 12, 2006
46,764
8
15,418
Aldershot
www.aerin.co.uk
Upvote 0
Thanks again for the suggestions, my host has come back with the following:

Regarding your query, the domain leyburnsolutions.com is currently configured to utilize PHP 8.2 version. If you wish to execute scripts using same PHP version outside document root, you can do so manually by running the command "/opt/cpanel/ea-php82/root/usr/bin/php ./script.php". You have the flexibility to replace "ea-php82" with any other PHP version available on our server.

So apologies for what is probably a daft question but where/how do I run the command?

John
 
Upvote 0
You'll need to connect to the server using SSH.

If you look in cpanel, there may also be a way to connect to the SSH console via the web interface.

Thanks, not something I've ever done before so very much in the dark here.

I've got PuTTY (which I believe can be used for this) and I've entered the host name and a connection type of SSH. I get a terminal window asking for a login but, when I enter that, I get a message 'No public supported authentication methods available'

John
 
Upvote 0

Latest Articles

Join UK Business Forums for free business advice