DevKinsta Docker WPCLI with PHP 8.1

I needed PHP version 8.1 for my CLI in DevKinsta Docker, but it was 7.4. So I found this quick way to change to version 8.1.

Login as super user

$ docker exec -u 0 -it devkinsta_fpm bash

Change PHP version CLI

$ sudo update-alternatives –set php /usr/bin/php8.1

Login as www-data user

$ docker exec -u www-data -it devkinsta_fpm bash

Move to WordPress project

$ cd /public/projectname

Run WP CLI commands

$ wp —info

Leave a Reply

Your email address will not be published. Required fields are marked *

Robbert Vermeulen

Need help from a WordPress expert?

I would love to hear about your project and how I can help you achieve your goals