As described in the official Kinsta Blog I would expect the
wp_get_environment_type() method to return
development on DevKinsta websites.
A workaround is just defining
define( 'WP_ENVIRONMENT_TYPE', 'development' ); within the
wp-config.php file, but I would expect it similar to the Kinsta production and staging environments to be set automatically as this is easily forgot.
Q: DevKinsta Version
A: Version 1.0.2 (184.108.40.2066)
Q: OS Version
A: macOS 10.15.6
Q: Docker Desktop Version
Welcome to DevKinsta @jaschaio .
wp_get_environment_type defaults to
production so it makes sense that it would show that. Great idea to get this added though. I’ve moved this over to feature requests for our developer’s to take a look at. Thanks for the suggestion!
Just wanted to drop in and say that if you “depend” (I would argue that you shouldn’t) on
WP_ENVIRONMENT_TYPE you can work around it until DevKinsta is able to set it for you, if they will
- Enter the DevKinsta docker container and edit the fpm configuration:
$ docker exec -it devkinsta_fpm bash
$ cd /etc/php/7.4/fpm/pool.d
$ nano www.conf
- Append the following line in the end of
env[WP_ENVIRONMENT_TYPE] = local
- Restart the container with
docker restart devkinsta_fpm
Note that I had to install
nano before I could get this working:
docker exec devkinsta_fpm bash -c "apt-get update;apt-get -y install nano"