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

BMS51's avatar
Level 1

Envoyer Deploy fails : Root composer.json requires php ^8.1 but your php version (8.0.28) does not satisfy that requirement.

Hey all,

So recently i've upgrade my server from PHP 8.0.28 to PHP 8.1.16. This change was needed to prepare the migration from Laravel 9.x to 10.x which is due soon.

Currently i've upgraded everything in the project to be compatible with PHP 8.1, unfortunately the deploy fails. And this is where it gets a bit strange. If i connect to my server via SSH in terminal or a remote server with my designated user / password and i run the command php -v i get the following result :

PHP 8.1.16 (cli) (built: Feb 20 2023 13:55:35) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.16, Copyright (c) Zend Technologies

When i add a hook to envoyer at the beginning of the deployment and execute the command php -v (for the same user (but with ssh_key) I take a look at the output ... Iget a different version of PHP

PHP 8.0.28 (cli) (built: Feb 20 2023 13:55:35) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.16, Copyright (c) Zend Technologies

I've contacted the admins for the server and they confirm that this version of PHP is not running on my server anymore... yet Envoyer.io has a connection to this php version.

I closed all connections for the user with pkill command, and verified with who that the user is not connected anymore. It looks like that Envoyer.io has somekind of open connection or something or caching. Anyone else experienced this behaviour before? And how do i Solve it? I've Reached out to the Envoyer.io Team but have yet to receive feedback.

If i do the deployment manually on my server everything works fine.

Currently i'm out of ideas ...

0 likes
2 replies
LaryAI's avatar
Level 58

It sounds like Envoyer is caching the old version of PHP and not recognizing the new version. You can try clearing the cache by running the following command:

php artisan cache:clear

If that doesn't work, you can try restarting the Envoyer service with the following command:

sudo service envoyer restart

If that still doesn't work, you can try deleting the Envoyer configuration file and restarting the service:

sudo rm /etc/envoyer.conf
sudo service envoyer restart

If none of these solutions work, you can try reaching out to the Envoyer support team for further assistance.

BMS51's avatar
Level 1

@LaryAI

And for those with similar error. Turned out to be related to the server, when the server did and update or restarted. One of the profiles switched back to an older version of PHP. Resolved on server side

Please or to participate in this conversation.