How do you run composer actions like install and others?
PHP Fatal error in laravel
I got the following error in my project,
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 5.6.40. in /home/kwqyxerxjq5u/public_html/development/blogs/vendor/composer/platform_check.php on line 25
but my server PHP version is 7.3, I don't know why this happens
@bugsysha I just run composer:install
@bugsysha and also I tried with composer install --ignore-platform-reqs , but i got some other error i given below.
PHP Parse error: syntax error, unexpected ':', expecting '{' in /home/kwqyxerxjq5u/public_html/development/blogs/vendor/symfony/polyfill-php80/bootstrap.php on line 23
add this line in config object of composer.json file
"platform-check": false
run php artisan config:cache
then run composer dump-autoload in terminal
@van1310 that is a bad suggestion.
@van1310 Hi, Thanks for the reply. already I tried with this, getting another error
@bugsysha we need a downvote button
@Snapey 🤣
@van1310 we are not laughing at you, we are laughing at the suggestion of the downvote button. It is more related to the state of the forum where we have a bunch of spam and other bad things going on.
I've replied to you politely. Don't be demotivated so easily and don't ask for support. You don't need it because you can do it on your own. Also, don't get offended by everything because this was not related to you and the world doesn't revolve around you.
If you check some of the threads where I've participated recently, you'll see that my suggestions were bad also because of different reasons.
@van1310 I can now get offended that you've mentioned @snapey first instead of me. Why did you do that? Are you trying to demotivate me to support people like @jeevamugunthan? See?
@bugsysha okay so sorry for that i m really sorry
@van1310 The reaction was because your response was the exact opposite of what is required.
So apparently you need to run those commands with the correct PHP version. Do you have multiple versions of PHP installed on the system? It is better to execute those commands with an absolute path. SSH into your server and run php -v and which php will give you more info on what is being used.
@bugsysha No, I'm using shared hosting, there is no multiple PHP version, I set 7.3 as the current PHP version in the server.
I tried in ssh, for PHP-v I got the below
PHP 7.3.30 (cli) (built: Aug 24 2021 11:24:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.30, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.30, Copyright (c) 1999-2018, by Zend Technologies
@jeevamugunthan uh, sorry. Can't help with shared hosting.
@bugsysha Hmm, any other suggestion.?
@jeevamugunthan I think that for the price you are paying for that shared hosting you can get VPS where you will have SSH access and won't have to fight with the platform to make your app work. So try to think about it and see if you can change it.
into composer.json>require>php>insert this code :
"php": "^7.3|^8.0",
@johnDoe220 you can see in the initial post that it is complaining about using PHP 5.6.40. and not 8.
@bugsysha first add php 8 and running composer update command
@johnDoe220 OK.
if not solved problem,update composer with command : composer self-update
Check the later posts here;
https://stackoverflow.com/questions/32750250/tell-composer-to-use-different-php-version
If Composer says you're running 5.6.40, then that's what you're running.
Yeah, you ran php -v but that version of the PHP executable in your path isn't necessarily the version of PHP that is running when you make web requests. So Look into your Nginx/Apache config and your PHP-FPM config to see what's going on.
Please or to participate in this conversation.