The johnpbloch/wordpress:4.7 upgrade issue

I spent a bit of time on this and since original post is closed wanted to expand a tiny bit on my experiences with the solution by @fullyint :

Local dev

# run commands in local machine Bedrock `site` dir

composer remove johnpbloch/wordpress

composer clear-cache

composer require johnpbloch/wordpress:4.7.3

# NOTE I used: composer require johnpbloch/wordpress
# to get the latest version

git add…, git commit…, git push…

Remote server

# run commands in local machine `trellis` dir
# edit `production` to be your <environment>
# edit `example.com` to be your site name

ansible "web:&production" -m command -a "composer clear-cache" -u web

ansible-playbook deploy.yml -e env=production -e site=example.com -e 'project_copy_folders=[]'

If you have customized project_copy_folders, just temporarily remove vendor from your project_copy_folders and run deploy.yml (instead of using -e 'project_copy_folders=[]' in second command above).

My Notes

I had previously upgraded to johnpbloch/wordpress:4.9 to I did not include the version number in composer require johnpbloch/wordpress.

This, today, adds johnpbloch/wordpress: '^4.9' to the composer.json file.

I was still getting an error on deploy : WordPress Installed?:

PHP Fatal error:  Uncaught Error: Call to undefined function apply_filters()

Solution was to ssh into the server and run sudo wp cli update --allow-root.

Thanks as always. Happy New Year Roots Community.

This is not the appropriate solution. Also, I feel like this thread is unrelated to the thread that you originally linked :confused:

I agree that it’s unrelated, Ben–and thank you–but it was another issue that was preventing the deploy : WordPress Installed? from completing so became a red herring for me. In other words I was thinking that the first solution wasn’t working.

I’d love to know your suggestion on what the appropriate solution would be to PHP Fatal error: Uncaught Error: Call to undefined function apply_filters() if you have the bandwidth to point me in a better direction.

Update the WP-CLI version in trellis/roles/wp-cli/defaults/main.yml then re-provision :slight_smile: