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

timgavin's avatar

Wrong PHP version detected

I'm deploying with Envoyer and have created a couple deployment hooks. The hooks repeatedly fail saying I'm using PHP 8.0, yet ServerPilot says 8.1.

I also created a phpinfo.php file inside public and phpinfo() says PHP is 8.1.18.

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.28. in /srv/users/comet/apps/comet/releases/20230424180129/vendor/composer/platform_check.php on line 24

PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.28. in /srv/users/comet/apps/comet/releases/20230424180129/vendor/composer/platform_check.php on line 24

Any ideas?

0 likes
5 replies
martinbean's avatar

@timgavin Well the CLI version of PHP you’re using is reporting it’s PHP version 8.0.28. You should always be using the same versions of PHP across environments.

timgavin's avatar

My development laptop has 8.2, and I was trying to use 8.2 on the server but there was an issue so I had to drop it down a version.

What do you mean by this: "Well the CLI version of PHP you’re using is reporting its PHP version 8.0.28?" Are you referring to my development environment?

timgavin's avatar

@MohamedTammam On the server, yes. I can upgrade and downgrade to whichever version I want, but I put the path to 8.1 into Envoyer, and as I mentioned phpinfo() reports 8.1, so not sure how to resolve this.

Snapey's avatar

@timgavin phpinfo.php will show you the php version that your web server (apache / nginx) sees, not the version being used on the command line.

You may need to change the path to the correct executable

Please or to participate in this conversation.