ansible-for-devops icon indicating copy to clipboard operation
ansible-for-devops copied to clipboard

Update to PHP 8.1

Open thescalaguy opened this issue 2 years ago • 2 comments

Hello.

I am currently following the code in the book. While trying to run the playbook to provision Drupal, the task which creates a new project using Composer would fail. Updating to PHP 8.1 fixed the issue.

thescalaguy avatar Jun 19 '22 13:06 thescalaguy

This makes sense; I haven't updated the Drupal examples in a while, but PHP 8.1 is the current version and should work better with modern PHP apps.

geerlingguy avatar Jun 19 '22 16:06 geerlingguy

This makes sense; I haven't updated the Drupal examples in a while, but PHP 8.1 is the current version and should work better with modern PHP apps.

Could you please run the playbook once and merge the PR?

I also had to change the private IP in the Vagrantfile. As per this answer on Stackoverflow, the allowed range is between 192.168.56.1 and 192.168.63.254; anything outside this range fails. Updating the private IP to 192.168.56.8 fixes this issue. I am using Vagrant 2.2.13. I can push that fix as well.

thescalaguy avatar Jun 20 '22 05:06 thescalaguy

@thescalaguy Can you update your pull request to PHP 8.2 and Drush 11? voegelas/ansible-for-devops@96cfe6d81328e185444009c51a3f408c89f53426 works for me.

Drupal does not longer support PHP 7.4, which reached its end of life in November 2022. The playbook fails with "drupal/core 10.0.2 requires php >=8.1.0 -> your php version (7.4.33)".

Drupal on PHP 8 requires Drush 11. See https://www.drush.org/latest/install/#drupal-compatibility.

voegelas avatar Feb 01 '23 09:02 voegelas

Same issue. Waiting for the merge completion @geerlingguy My version worked perfectly with PHP 8.2 as was mentioned by @voegelas

Omitted package 'php8.1-json' and 'php7.4-json', as it throws an error that it can't find installation candidate.

Opened PR for 8.2 version: https://github.com/geerlingguy/ansible-for-devops/pull/526

Brain2life avatar Feb 11 '23 07:02 Brain2life

Thank you for the PR, and sorry about not merging it sooner! I decided to merge https://github.com/geerlingguy/ansible-for-devops/pull/526 since it is using the latest version and should be valid a bit longer, otherwise I would've had to do it myself. I will give you both credit in the historical changelog (which right now isn't in the book, haven't figured out a good way to incorporate it!).

geerlingguy avatar Jun 18 '23 03:06 geerlingguy