-2

I made a symfony project on php 7.4, however it seems like OVH php version is 7.3.16.

Which folder are not necessary for deployment and how can I adapt my composer for a different php version ?

Here's the error I get while accessing to my website :

Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.16. 
ben-ju1
  • 11
  • 5
  • 1
    Your best bet is to change your development machine to 7.3.16. Even if you get the composer stuff straightened out, you might still introduce syntax incompatible with the earlier php version. Better yet of course would be to update your OVH version. Not recommended but you can also set your [php platform version](https://andy-carter.com/blog/composer-php-platform). – Cerad Apr 27 '20 at 15:16
  • Does this answer your question? [Use php 7 to run composer, but install packages for php 5](https://stackoverflow.com/questions/45847258/use-php-7-to-run-composer-but-install-packages-for-php-5) – Nico Haase Apr 27 '20 at 15:42
  • @Cerad I already changed my development machine to 7.3.16 however it still says that my composer is made for a 7.4 an higher version, I tried to recreate a new composer with the good php version and I still get the same error – ben-ju1 Apr 27 '20 at 20:30
  • @NicoHaase I've seen this post but it's about docker to a prod environnement, since I'm pretty much lost I tried the method in your link and nothing is working for me – ben-ju1 Apr 27 '20 at 20:31
  • You just need to generate a new composer.lock file by deleting composer.lock and running "composer install". Hopefully it will work cleanly though going backwards in versions is always a bit of a crap shoot. – Cerad Apr 27 '20 at 21:27
  • @ben-ju1 even if the linked question mentions Docker, you can apply the exact same solution to your problem, as the problem itself is not related to Docker – Nico Haase Apr 28 '20 at 10:12

1 Answers1

0

OVH offer a way to change the PHP version used by your domain.

Check Details of the .ovhconfig file for more information about it. You should also have an option in the control panel about it.

  • I already set the higher version of php in OVH which is 7.3, I tried everything in the link you sent, nothing seems to work – ben-ju1 Apr 27 '20 at 20:29