What does php -v give you?
[ErrorException] Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.21.
Getting this error with : composer dump-autoload on production server.
The server is already using php 8.1.0 ? Any help ?
[ErrorException] Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.21.
PHP 8.1.8 (cli) (built: Jul 22 2022 18:34:40) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.8, Copyright (c) Zend Technologies with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
@FounderStartup Try this
which composer
copy the path and run it like this
php /path/to/composer install
On my local machine :
PHP 8.1.6 (cli) (built: May 12 2022 03:00:45) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.6, Copyright (c) Zend Technologies with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies
@FounderStartup Ok. But I assume the problem is on production? Did you try my suggestion ?
@FounderStartup "on your local machine". This is the same place you are having the issue, yes? If not, i'm not sure why you would mention it
composer rarely lies. If it says you have php8.0 then that's what you have
@Snapey There is issue on production server. as I have mentioned the error. I am having php 8.1 already installed as I have confirmed.
@FounderStartup You can use this to see which php version it detected
composer -vvv about
@FounderStartup no you confirmed
On my local machine :
Any chance that the server has both php8.0 and php8.1, and the folder you are inside is set to run a different version than the server itself.
Composer - Dependency Manager for PHP - version 2.2.12 Composer is a dependency manager tracking local dependencies of your projects and libraries. See https://getcomposer.org/ for more information.
@FounderStartup Turn your eyes just a tiny bit up (first line of the output)
I solved the issue by copying the local 'vendor' folder to production :) . But thanks for your time chief.
@Snapey Sorry chief if I was unable to communicate properly :).
@FounderStartup Sounds like a bad idea. Again I gave you a workaround above :)
@FounderStartup BAD move
You might have temporarily got around the install issue, but at some point you code is going to hit a line of code that expects php8.1 and then blow up
@Snapey oops .... Yes I hurried a bit. Should have asked for advise first :).
@Sinnbeck Chief , I think I missed the step due to som any comments :). Can you tell me again if possible ,what is the best way to handle such situation ?
@FounderStartup Can you try what I suggested. You can start by running which composer on the server and post the output here
/opt/cpanel/composer/bin/composer
@FounderStartup now try
php /opt/cpanel/composer/bin/composer install
@Sinnbeck Yes its working now. But it worked when I updated the vendor folder. So in future will be careful about it :)
@Sinnbeck Please i have the same problem on production.. And my cpanel don't have a terminal to run that command 'which composer'.. So please any solution?
@FounderStartup Please why?
Good Morning am a beginner in Laravel I have a cpanel 106.0 (build 11) and Apache Version 2.4.54 and PHP Version 7.4.33
when i run my laravel project i get : Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".
i asked the service provider to enable 8.1 which they did and am now running php 8.1.0 but still am getting an error below: is currently unable to handle this request. HTTP ERROR 500
PLease help
Please or to participate in this conversation.