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

Docker container / PHP 7.3 incompatibility with latest WPVIP dev environment #94

Open
1 task done
cameronterry opened this issue Jun 14, 2022 · 1 comment · May be fixed by #98
Open
1 task done

Docker container / PHP 7.3 incompatibility with latest WPVIP dev environment #94

cameronterry opened this issue Jun 14, 2022 · 1 comment · May be fixed by #98
Labels

Comments

@cameronterry
Copy link

Describe the bug

Using WP Snapshots with the latest VIP Go MU Plugins changes, Automattic/vip-go-mu-plugins@51ccaa3#diff-f689ded77c119b968db89a8c3b868aa245442df4c8711edbe95d59c0a471d834R18, is causing the following error (project name omitted using *):

$ 10updocker wpsnapshots create
✔ Global services are running...
✔ MariaDB has started...
Project Slug (letters, numbers, _, and - only): ****
Snapshot Description (e.g. Local environment): ******* **** **** **** ****** *****
Include files in snapshot? (Y/n) y
Include database in snapshot? (Y/n) y

Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/html/wp-content/mu-plugins/healthcheck/class-healthcheck.php on line 18

That line in particular is using a coding convention introduced in PHP 7.4 and above: https://www.php.net/manual/en/language.types.declarations.php.

Using the following with the Docker CLI confirms that the WP Snapshots container is running PHP 7.3.x, which will be the cause of the error:

$ docker exec -it [container-name] /bin/bash
root@c67ea627f75b:/opt/wpsnapshots# php --version
PHP 7.3.9 (cli) (built: Sep 12 2019 10:57:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.7.0beta1, Copyright (c) 2002-2018, by Derick Rethans

Note: I previously created a ticket here, 10up/wp-local-docker-v2#305, incorrectly.

Steps to Reproduce

  1. Create a new environment using the 10updocker CLI.
  2. Add the vip-go-mu-plugins repository to the wp-content/mu-plugins directory, using the guide here: https://docs.wpvip.com/how-tos/local-development/#h-step-2-add-vip-go-mu-plugins.
  3. Run 10updocker wpsnapshots create.

Screenshots, screen recording, code snippet

No response

Environment information

  • Device: bespoke PC build
  • OS: Ubuntu 20.04.4 LTS
  • Docker Version: 20.10.16, build aa7e414

WordPress information

WordPress: 5.9.3
Themes: custom
Plugins:

  • Fieldmanager | Version 1.5.0 by Alley
  • Pardot | Version 1.5.7 by Salesforce
  • Save and Share Cart for WooCommerce | Version 1.0
  • WooCommerce | Version 6.5.1 by Automattic
  • WooCommerce Shipping & Tax | Version 1.26.0 by WooCommerce
  • Yoast Duplicate Post | Version 4.4 by Enrico Battocchi & Team Yoast

Code of Conduct

  • I agree to follow this project's Code of Conduct
@claytoncollie
Copy link

I think this is happening to me when I use union types (php8) in my project. It looks like wpsnapshots pulls the Docker image from the wp-local-docker-image repository which only supports up to PHP 7.3

I created a PR in the wp-local-docker-image to add PHP 7.4, 8.0, and 8.1 --> 10up/wp-local-docker-images#27

@tlovett1 Can you confirm that this is the case with PHP support in wpsnapshots?

cc @johnwatkins0 @tylercherpak

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

Successfully merging a pull request may close this issue.

2 participants