Kevin Steen Hansen
Kevin Steen Hansen

Reputation: 555

Docker, change of PHP version?

I'm new user of Docker and I'm stuck with a problem. I want to run Magento 2 using Docker, but when I'm opening my website I get this message:

Magento supports PHP 7.1.3 or later. Please read the Magento System Requirements.

Which makes sense because I checked my docker and its running 7.0.*, but I have been searching and searching on how to "upgrade" my PHP for Docker but without luck. Should I be lucky that a helpful person out there can lead me in which direction I have to go to find a solution for this?

I have added my yaml/yml file if needed:

version: '3'
services:
    web:
        image: webdevops/php-apache-dev:ubuntu-16.04
        container_name: web
        restart: always
        user: application
        environment:
          - WEB_ALIAS_DOMAIN=magento2.docker
          - WEB_DOCUMENT_ROOT=/app/pub
          - PHP_DATE_TIMEZONE=EST
          - PHP_DISPLAY_ERRORS=1
          - PHP_MEMORY_LIMIT=2048M
          - PHP_MAX_EXECUTION_TIME=300
          - PHP_POST_MAX_SIZE=500M
          - PHP_UPLOAD_MAX_FILESIZE=1024M
        volumes:
          - "./:/app:cached"
        ports:
          - "80:80"
          - "443:443"
          - "32823:22"
        links:
          - mysql
    mysql:
        image: mariadb:10
        container_name: mysql
        restart: always
        ports:
          - "3306:3306"
        environment:
          - MYSQL_ROOT_PASSWORD=root
          - MYSQL_DATABASE=magento
        volumes:
          - db-data:/var/lib/mysql
    phpmyadmin:
        container_name: phpmyadmin
        restart: always
        image: phpmyadmin/phpmyadmin:latest
        environment:
          - MYSQL_ROOT_PASSWORD=root
          - PMA_USER=root
          - PMA_PASSWORD=root
        ports:
          - "8080:80"
        links:
          - mysql:db
        depends_on:
          - mysql
volumes:
    db-data:
        external: false

Upvotes: 4

Views: 14944

Answers (1)

Nico Haase
Nico Haase

Reputation: 12112

You are using an image provided by webdevops. All tags of their PHP images can be found at https://hub.docker.com/r/webdevops/php-apache-dev/tags. Their documentation at https://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php-apache-dev.html tells you that the tag ubuntu-16.04 is deprecated and uses PHP 7.0 only.

If you are using no further customization, you could exchange the tag for a later one and see what happens.

Upvotes: 1

Related Questions