Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jeevamugunthan's avatar

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

0 likes
25 replies
bugsysha's avatar

How do you run composer actions like install and others?

jeevamugunthan's avatar

@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
vandan's avatar

@jeevamugunthan

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

vandan's avatar

@Snapey @bugsysha i am try to help so don't try to demotivate please support to junior develper your behaviour like not good please try to help us not demotivate don't try to laugh not every developer like you.

bugsysha's avatar

@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.

1 like
Snapey's avatar

@van1310 The reaction was because your response was the exact opposite of what is required.

bugsysha's avatar

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.

jeevamugunthan's avatar

@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
bugsysha's avatar

@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.

johnDoe220's avatar

into composer.json>require>php>insert this code :

"php": "^7.3|^8.0",
bugsysha's avatar

@johnDoe220 you can see in the initial post that it is complaining about using PHP 5.6.40. and not 8.

johnDoe220's avatar

if not solved problem,update composer with command : composer self-update

markjaquith's avatar

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.