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

env: Unable to start environment when using PHP<7.1 #40745

Open
westonruter opened this issue Apr 29, 2022 · 3 comments
Open

env: Unable to start environment when using PHP<7.1 #40745

westonruter opened this issue Apr 29, 2022 · 3 comments
Labels
[Tool] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@westonruter
Copy link
Member

Description

I'm attempting to start wp-env with PHP 5.6 but when I do so, I get an error:

✖ Error while running docker-compose command.
WordPress is already installed.
Success: Updated the constant 'WP_DEBUG' in the 'wp-config.php' file with the raw value 'true'.
Creating e6c93f608f26ae7e0e7a5f1fa29a6a3e_cli_run ...
Creating e6c93f608f26ae7e0e7a5f1fa29a6a3e_cli_run ... done
Error: Could not process the 'wp-config.php' transformation.
Reason: Unable to locate placement anchor.

Step-by-step reproduction instructions

Run:

 WP_ENV_PHP_VERSION=5.6 npm run wp-env start

This happens with PHP 7.0 as well. The errors no longer occur with PHP>=7.1.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@westonruter westonruter added [Type] Bug An existing feature does not function as intended [Tool] Env /packages/env labels Apr 29, 2022
@westonruter
Copy link
Member Author

Perhaps related to #29323?

@goosechaser
Copy link

In my case wp-env (5.2.0) only works with PHP 7.3+. I am getting the following errors for PHP 5.6-7.2:

❯ WP_ENV_PHP_VERSION=7.2 wp-env start
✖ Error while running docker-compose command.
Starting 99910537229199d62a7cacbecf1974d1_wordpress_1 ...
Starting 99910537229199d62a7cacbecf1974d1_wordpress_1 ... done
Creating 99910537229199d62a7cacbecf1974d1_cli_run     ...
Creating 99910537229199d62a7cacbecf1974d1_cli_run     ... done
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.

MacBook Pro M1 / Docker (engine: 20.10.13 / compose: 1.29.2) / arm64 & x86

@anton-vlasenko
Copy link
Contributor

anton-vlasenko commented Feb 8, 2023

I've ben able able to find a workaround. I've used

"phpVersion": "7.4"

to start the containers and install WordPress.
Then I stopped them and changed the value back to "5.6".
Then I started the containers again (with --update option) and this time there were no errors.
But this needs a proper fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants