Skip to content

set MySQL to 5.5.62 on PHP 7.4 #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 1.10.0
Choose a base branch
from
Draft

Conversation

lucatume
Copy link
Contributor

@lucatume lucatume commented Jun 13, 2025

This change aligns slic with the minimum WordPress requirements of PHP 7.2 and MySQL 5.5.

Link to WP requirements

As a concession to the fact that slic is a StellarWP tool, the minimum PHP version supported by it is PHP 7.4.

This is treated like a minor breaking change since it's breaking by default, but can be controller setting either the SLIC_DB_IMAGE or SLIC_DB_NO_MIN environment variables.

I've tested this on my Mac, and it all works: slic goes up with the database and all things work.

Some CLI "tests":

Using PHP 7.4 and not specifying the db image:

 $ SLIC_PHP_VERSION=7.4 slic config | awk '/^  db:/,/^  redis:/' | grep -v "^  redis:"
  db:
    environment:
      MYSQL_DATABASE: test
      MYSQL_ROOT_PASSWORD: password
    healthcheck:
      test:
        - CMD-SHELL
        - mysqlshow -u root -ppassword test
      timeout: 3s
      interval: 1s
      retries: 30
      start_period: 5s
    image: mysql:5.5.62
    networks:
      slic: null
    platform: linux/amd64
    ports:
      - mode: ingress
        target: 3306
        published: "9906"
        protocol: tcp
    tmpfs:
      - /var/lib/mysql

Using PHP 7.4 and specifying an image:

$ SLIC_PHP_VERSION=7.4 SLIC_DB_IMAGE=some-image:1.2.3 slic config | awk '/^  db:/,/^  redis:/' | grep -v "^  redis:"
  db:
    environment:
      MYSQL_DATABASE: test
      MYSQL_ROOT_PASSWORD: password
    healthcheck:
      test:
        - CMD-SHELL
        - mysqlshow -u root -ppassword test
      timeout: 3s
      interval: 1s
      retries: 30
      start_period: 5s
    image: some-image:1.2.3
    networks:
      slic: null
    ports:
      - mode: ingress
        target: 3306
        published: "9906"
        protocol: tcp
    tmpfs:
      - /var/lib/mysql

Using PHP 7.4 and specifying no-min db image:

 $ SLIC_PHP_VERSION=7.4 SLIC_DB_NO_MIN=1 slic config | awk '/^  db:/,/^  redis:/' | grep -v "^  redis:"
  db:
    environment:
      MYSQL_DATABASE: test
      MYSQL_ROOT_PASSWORD: password
    healthcheck:
      test:
        - CMD-SHELL
        - mysqlshow -u root -ppassword test
      timeout: 3s
      interval: 1s
      retries: 30
      start_period: 5s
    image: mariadb:10.7.8
    networks:
      slic: null
    ports:
      - mode: ingress
        target: 3306
        published: "9906"
        protocol: tcp
    tmpfs:
      - /var/lib/mysql

Using a version of PHP gt 7.4:

$ slic php-version set 8.0 && slic config | awk '/^  db:/,/^  redis:/' | grep -v "^  redis:"
  db:
    environment:
      MYSQL_DATABASE: test
      MYSQL_ROOT_PASSWORD: password
    healthcheck:
      test:
        - CMD-SHELL
        - mysqlshow -u root -ppassword test
      timeout: 3s
      interval: 1s
      retries: 30
      start_period: 5s
    image: mariadb:10.7.8
    networks:
      slic: null
    ports:
      - mode: ingress
        target: 3306
        published: "9906"
        protocol: tcp
    tmpfs:
      - /var/lib/mysql

This change aligns `slic` with the minimum WordPress requirements of PHP
7.2 and MySQL 5.5.
As a concession to the fact that `slic` is a  StellarWP tool, the
minimum PHP version supported by it is PHP `7.4`.

This is treated like a minor breaking change since it's breaking by
default, but can be controller setting either the `SLIC_DB_IMAGE` or
`SLIC_DB_NO_MIN` environment variables.
@lucatume lucatume self-assigned this Jun 13, 2025
Copy link
Contributor

@defunctl defunctl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand why we want to do this. Is it to just test the lowest version of things our plugins would run on?

Even then, it looks like MySQL 5.5.x usage is now at 6.7%: https://wordpress.org/about/stats/

image

Although we don't know the combination usage, with PHP 7.4 usage at 28% still, shouldn't we assume most of those users aren't running MySQL 5.5.5?

That makes me think we shouldn't default to it, but still allow developers to change to use it if they want to test it in their matrix.

@@ -4,8 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [1.10.0] - 2025-06-13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any breaking change should be a major version to properly follow semver, e.g. 2.0.0

@defunctl
Copy link
Contributor

Also, if you're running one PHP 7.4 project with 5.5.5 and switch to a project that should use MariaDB, does the slic use command automatically spin up the correct db container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants