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

I'm Robbert Vermeulen. I document everything I learn and help thousands of people with coding WordPress. My site has no ads or sponsors. If you enjoy my content, please consider supporting what I do.

Comments

    No comments yet..

Leave a reply

Feel free to ask questions or make comments.