eko / docker-symfony

Run a Symfony application using Docker & docker-compose
BSD Zero Clause License
1.29k stars 475 forks source link

Error with php version #119

Closed davidt22 closed 4 years ago

davidt22 commented 4 years ago

Hi, there is an error when accesing to website:

Fatal Error: composer.lock was created for PHP version 7.3 or higher but the current PHP version is 7.2.22.

Can you fix it, please ? Thanks

eko commented 4 years ago

Hi @davidt22,

Have you checked out the repository recently? Because the Dockerfiles specify a alpine:3.10 version and the corresponding PHP versions are 7.3.11-r0, see: https://pkgs.alpinelinux.org/packages?name=php7-fpm&branch=v3.10

I don’t think there is an issue here, it works for me. Could you double check please?

ghost commented 4 years ago

Hi, i have the same problem. In cmd when i put php -v it says php 7.1

hiroki-it commented 4 years ago

@davidt22 @florianproxi

Hello!!

I had the same problem, but solved it in the following steps. :smiley:

I'm sorry that it's hard to read, because I'm not good at English. :sweat:

  1. To define the following in config of your composer.json
"config": {
    "platform": {
        "php": "7.2.22"
}
  1. To delete your composer.lock

  2. To execute composer install

  3. To try http://symfony.localhost

I hope you will go well. :thumbsup:

eko commented 4 years ago

Thank you for helping each other with this issue 👍 :)

Closing this now

Kaesthenics commented 4 years ago

Thank you very much from france!!!

cluis13915 commented 4 years ago

I solved it switching the Apache PHP version.

sudo a2dismod php7.1
sudo a2enmod php7.2
sudo systemctl restart apache2
happy-code-time commented 3 years ago

Have this error

Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.23.

But the console gives me this output on php -v:

7.4.11

I have try:

1) sudo rm -rf /etc/php/7.1 sudo rm -rf /etc/php/7.2 sudo rm -rf /etc/php/7.3 sudo rm -rf /etc/php/8.0 sudo systemctl restart apache2

2) rm composer.lock composer update

3) rm composer.lock rm -rf vendor composer install sudo systemctl restart apache2

4) Finally it works for me

sudo a2dismod php7.1 sudo a2dismod php7.2 sudo a2dismod php7.3 sudo a2dismod php8.0

sudo a2enmod php7.4

sudo systemctl restart apache2