timber/starter-theme

Composer Platform Check Bug

Closed this issue · 5 comments

Hi there,
I hope someone can help me with the following issue.

I'm running a WordPress project in Docker Container. This is the docker-compose.yml file:

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: "no"
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8888:80"
    restart: "no"
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DEBUG: 1
    working_dir: /var/www/html
    volumes:
      - ./wp-content:/var/www/html/wp-content
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
  db_data: {}

After creating Conatiner and Image I run the following command inside the themes folder composer create-project upstatement/timber-starter-theme --no-dev to install the theme.

When I activate the theme I get a fatal error saying Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".

I checked globally and locally and my PHP version is 8.1.6. Is there a way to fix this issue? Please note that I'm not getting this error if I use an old version of this theme that I have previously used in another WP project.

Hi @prussobcm ,

I am not using Docker on a daily basis but tried to recreate your issue. I created your docker file and run docker compose. After setup I cd into the themes directory and run composer create-project upstatement/timber-starter-theme --no-dev as well.

I did not run into any issues however. When in the commandline and running php -v I got:

PHP 8.1.26 (cli) (built: Nov 24 2023 08:49:33) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.26, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.26, Copyright (c), by Zend Technologies
    with Xdebug v3.3.0, Copyright (c) 2002-2023, by Derick Rethans

Can you test your version as well. This reported version is the one used by composer as far as I know.

Hi @Levdbas,
Thanks for your response.

I checked my php -v and got the same result php 8.1.26.

I guess it's either that Docker is running a different php version that I'm not aware of or there is a bug in the Timber/Twig theme.

Hi @prussobcm , and If you disable the theme for a whole and login to your new WP instance and check via Tools and then site health and there check the running PHP version. Can you find out what is being reported?

Hi @Levdbas,
Under site check I can see that it's 7.4.30.

I think I have found the problem.

I have updated my mysql version to 8 with image: mysql:8.0 and my WP php version to 8 with image: wordpress:6.0-php8.1-apache.

Now it's working properly and I don't have the DB and PHP warnings inside the Site Health Check.

Thanks to @Levdbas for pointing out where to check the WP PHP version. Appreciated.