Skip to content
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

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". #1251

Closed
ericlathrop opened this issue Mar 29, 2024 · 6 comments · Fixed by #1267

Comments

@ericlathrop
Copy link

Baikal version:

Baikal 0.9.5
PHP 8.3.4

Expected behaviour:

Baikal should show its web page.

Current behaviour:

Baikal shows this message:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".

Steps to reproduce:

I'm using the following Dockerfile to build my baikal image:

FROM php:fpm-alpine3.19

ARG version

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
  apk add --no-cache msmtp

COPY msmtp-php.ini /usr/local/etc/php/conf.d/msmtp.ini

RUN \
  mkdir /app && \
  wget -O baikal.zip  https://github.com/sabre-io/Baikal/releases/download/${version}/baikal-${version}.zip && \
  unzip baikal.zip -d /app && \
  mv /app/baikal/* /app && \
  rm -rf /app/baikal && \
  rm -rf /app/config && \
  rm -rf /app/Specific && \
  rm -f baikal.zip

WORKDIR /app

and I'm using the following docker-compose.yml to get the app running with nginx:

version: "3.7"

networks:
  baikal:
  web:
    external: true

services:
  web:
    depends_on:
      - php
    image: nginx:alpine
    labels:
      traefik.docker.network: web
      traefik.enable: "true"
      traefik.http.routers.baikal.rule: Host(`baikal.mydomain.test`)
      traefik.http.routers.baikal.tls: true
      traefik.http.routers.baikal.tls.certresolver: leresolver
      traefik.http.routers.baikal.tls.domains[0].main: "mydomain.dev"
      traefik.http.routers.baikal.tls.domains[0].sans: "*.mydomain.dev"
    networks:
      - baikal
      - web
    restart: always
    volumes:
      - static-content:/app
      - ./nginx.conf:/etc/nginx/conf.d/baikal.conf

  php:
    image: ericlathrop/baikal-php-fpm-7:0.9.5
    networks:
      - baikal
    user: "{{ baikal_user_id.stdout }}:{{ baikal_group_id.stdout }}"
    restart: always
    volumes:
      - static-content:/app
      - ./config:/app/config
      - ./Specific:/app/Specific
      - ./msmtprc:/etc/msmtprc

volumes:
  static-content:

This works fine with 0.9.4. Searching the error message didn't give me much help.

@acanton77
Copy link

acanton77 commented Apr 27, 2024

This happened to me today after the update to .0.9.5. I'm running PHP 8.0. I went to .....baikal/vendor/composer/platform_check.php and commented out line 8 (below).

if (!(PHP_VERSION_ID >= 80100)) {
// $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}

This WORKED. I was able to bring up the Admin screen.

Eventually I'll update my Linode Ubuntu 20.04 to PHP 8.1.

What is "Composer" and why do we need it? I tried putting in an 'exit' statement at the top of the 'platform_check.php' module but I got the white-screen-of-death when I tried to bring up the Admin system. So I just commented out the one line and it now works.

@acanton77
Copy link

acanton77 commented Apr 27, 2024

NOT WORKING AGAIN!
I updated the server to PHP 8.3.6 and now Admin won't work... I get the white screen of death. I don't know what module is giving it to me. I need to figure out how to turn on errors in PHP via .htaccess and that might help.

Something in Baikal admin does not like PHP 8.3.

UPDATE
UPDATE
UPDATE

I turned on the errors in .users.ini (for PHP) and I saw the message:

"pdo sqlite could not find driver...."

The white screen of death was because when I updated to PHP 8.3 I failed to install

sudo apt-get install php8.3-sqlite

(Note: For other PHP versions, use sudo apt-get install phpX.Y-sqlite after replacing X.Y with your PHP version number.
see: https://help.getastra.com/en/article/how-to-install-sqlite-for-php-on-a-apachenginx-server-1wj96n5/)

Once I did that everything worked again. (I did not have to comment out any code.)

@Leepic
Copy link

Leepic commented May 28, 2024

I've the same issue after upgrading from 0.9.4 to 0.9.5 using PHP 7.4.33 (Debian 11).

Workaround in vendor/composer/platform_check.php :

-if (!(PHP_VERSION_ID >= 80100)) {
+// if (!(PHP_VERSION_ID >= 80100)) {
+// See: https://github.com/sabre-io/Baikal/issues/1251
+if (!(PHP_VERSION_ID >= 70200)) {

Baïkal is marked supported by PHP 7.4, I think that this bug was introduce when upgrading symfony/yaml from ^3.4 to ^5.4 because symfony/yaml added symfony/deprecation-contracts version ^3" as a new requirement and symfony/deprecation-contracts require PHP ^8.1 in version 3.5.0.

Downgrading symfony/yaml from ^5.4 to ^5.3 in composer.json will fix this bug (not tested).

@acanton77
Copy link

I've heard that Baikal is going to be replaced by some new Sabre front-end system, but I don't know any more than that. Baikal has worked fine for me. While I use iCloud as my primary address book with BusyContacts (on Mac) as the front end, I also have two Baikal servers... on two different hosting companies. Busy Contacts does a good job keeping everything synced to the iCloud "master."

@phil-davis
Copy link
Contributor

phil-davis commented May 29, 2024

@Leepic when I have PHP 7.4 and do composer install in Baikal I get:
symfony/yaml v5.4.39

And that has:

            "require": {
                "php": ">=7.2.5",
                "symfony/deprecation-contracts": "^2.1|^3",
                "symfony/polyfill-ctype": "^1.8"
            },

That allows symfony/deprecation-contracts major version 2 or 3 to be used.
composer selects symfony/deprecation-contracts v2.5.3

It is working for me.

@ByteHamster
Copy link
Member

I think the problem is that I created the release builds (for people not using composer) on a machine with a more recent php version. For the release builds we should instruct composer to use the lowest supported version. Working on a PR now.

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 a pull request may close this issue.

5 participants