Closed retlehs closed 2 years ago
So I actually have the same problem. I have changed trellis/group_vars/all/main.yml to 8.1 and provision production then I changed it back to 8.0 and I cannot deploy. I have disable install_recommends for php packages #1355 but it didn't fix the problem. I run Trellis 1.11.0
I've also tried a brand new staging. I have provision it without any problem but getting the following error on deploy (on both staging and production). Development works without any problems.
`non-zero return code PHP Deprecated: Return type of WP_Hook::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 498 PHP Deprecated: Return type of WP_Hook::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 511 PHP Deprecated: Return type of WP_Hook::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 524 PHP Deprecated: Return type of WP_Hook::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 537 PHP Deprecated: Return type of WP_Hook::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 548 PHP Deprecated: Return type of WP_Hook::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the
notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 440 PHP Deprecated: Return type of WP_Hook::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the
notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 454 PHP Deprecated: Return type of WP_Hook::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 468 PHP Deprecated: Return type of WP_Hook::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the
notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp- includes/class-wp-hook.php on line 485 Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. fatal: [164.90.179.180]: FAILED! => {"changed": false, "cmd": ["wp", "core", "is-installed", "--skip-plugins", "--skip-themes", "--require=/srv/www/staging.marcinkujanek.pl/shared/tmp_multisite_constants.php"], "delta": "0:00:00.160059", "end": "2022-01-20 17:05:31.745676", "failed_when_result": true, "rc": 1, "start": "2022-01-20 17:05:31.585617", "stderr_lines": ["PHP Deprecated: Return type of WP_Hook::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 498", "PHP Deprecated: Return type of WP_Hook::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 511", "PHP Deprecated: Return type of WP_Hook::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 524", "PHP Deprecated: Return type of WP_Hook::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 537", "PHP Deprecated: Return type of WP_Hook::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 548", "PHP Deprecated: Return type of WP_Hook::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 440", "PHP Deprecated: Return type of WP_Hook::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 454", "PHP Deprecated: Return type of WP_Hook::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 468", "PHP Deprecated: Return type of WP_Hook::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/www/staging.marcinkujanek.pl/releases/20220120170412/web/wp/wp-includes/class-wp-hook.php on line 485", "Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress."], "stdout": "", "stdout_lines": []} `
It's possible that fix doesn't work in all situations I guess.
Try manually running this: sudo update-alternatives --config php
If there's multiple PHP versions installed it will give you the choice to set the default.
It's possible that fix doesn't work in all situations I guess.
Try manually running this:
sudo update-alternatives --config php
If there's multiple PHP versions installed it will give you the choice to set the default.
This has solved my problem. Thank you @swalkinshaw
I ran into the same problem changing to php 8.0 using sudo update-alternatives --config php
works.
However I just provisioned the server and changed PHP version php_version: "8.0"
in group_vars/all/main.yml
and still got 8.1 when provisioning for the first time 🤔
I ran into the same problem changing to php 8.0 using
sudo update-alternatives --config php
works.However I just provisioned the server and changed PHP version
php_version: "8.0"
ingroup_vars/all/main.yml
and still got 8.1 when provisioning for the first time 🤔
You need to login to the server as a root and do sudo update-alternatives --config php
Yeah evidently https://github.com/roots/trellis/pull/1355 doesn't entirely fix this for some unknown reason. I think we'll need to handle the update-alternatives --config php
part automatically in Trellis.
Not sure if it warrants an additional bug report as it seems related… so I'll just comment here to say I also ran into an issue where a PHP extension was not available and this blocked the composer install
on the Vagrant VM:
$ composer install …
squizlabs/php_codesniffer 3.6.2 requires ext-simplexml * -> it is missing from your system. Install or enable PHP's simplexml extension
After vagrant ssh
I ran php --ini
and saw that PHP 8.1 was in use (despite having set php_version: "8.0"
in trellis/group_vars/all/main.yml
).
The workaround noted above worked; after the CLI version of PHP was set to 8.0, composer install
worked as expected.
Update:
I also had to re-provision. So here's what I did, from the top:
$ trellis up # This will fail part way through due to the bug discussed in issue #1354
$ vagrant ssh
# Then, on the VM:
$ sudo update-alternatives --set php /usr/bin/php8.0
# then exit the VM and run this on the host:
$ trellis provision development
Description
What's wrong?
When provisioning a new server, the
wordpress-install
task fails at Install WPWhat insights have you gained?
https://github.com/oerdnj/deb.sury.org/issues/1711
Possible solutions
Temporary workarounds
Switch to PHP 7.4 @ https://github.com/roots/trellis/blob/1dca397c8dbf9024d77d8e730e618824dcdd256c/group_vars/all/main.yml#L6
Steps To Reproduce
Expected Behavior
Actual Behavior
Server installs PHP 8.1 and provisioning fails
Relevant Log Output
Versions
1.12.0