Skip to content

docker compose up --build fails on master: Dockerfile pins PHP 7.3 but composer.lock requires PHP >= 8.4 #165

@mahmoodhamdi

Description

@mahmoodhamdi

Summary

docker compose up --build on a fresh clone of master fails during the composer install step inside the container because the Dockerfile base image (php:7.3-apache) is two major PHP versions behind what composer.json / composer.lock require.

Steps to reproduce

git clone https://github.com/sunnah-com/website.git
cd website
cp .env.local.sample .env.local
docker compose up --build

Observed

composer install aborts with version constraint errors. Selected output:

- yiisoft/yii2 2.0.54 requires php >=7.4.0 -> your php version (7.3.33) does not satisfy that requirement.
- symfony/var-dumper v8.0.8 requires php >=8.4 -> your php version (7.3.33) does not satisfy that requirement.
- symfony/yaml v8.0.10 requires php >=8.4 -> your php version (7.3.33) does not satisfy that requirement.

The build then fails:

failed to solve: process "/bin/sh -c composer install" did not complete successfully: exit code: 2

Root cause

  • Dockerfile line 1: FROM php:7.3-apache → PHP 7.3.33 in the container.
  • composer.json requires "php": ">=8.3.0".
  • composer.lock pins several dependencies (notably symfony/var-dumper, symfony/yaml, transitive deps of codeception) that require PHP >= 8.4.

The result is that the documented "Quick start" path in the README cannot succeed on master as it currently stands.

Suggested fix

Bump the base image to php:8.4-apache to match the composer.json and composer.lock constraints:

-FROM php:7.3-apache
+FROM php:8.4-apache

PHP 8.4 is the current GA release and is the minimum compatible version implied by composer.lock. No other Dockerfile changes appear necessary — the pdo, pdo_mysql, and mysqli extensions, plus Apache's rewrite module, are all still installed the same way on PHP 8.4.

I verified this locally: applying the one-line change above lets docker build complete successfully, including composer install (28.5s), and the image builds end-to-end.

I'm happy to send a PR with this change if it would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions