Can I set JETPACK_DEV_DEBUG in .env?


Loving Bedrock!

Can I set Jetpack’s debug mode in .env or does it have to be done in development.php? I’ve tried setting:


in .env but the setting will not take.

Thank you!

Environment variables are not the same as PHP constants. It’s a pretty easy mistake to make though, and sometimes I do still forget that they’re not the same.

Notice the actual PHP constants are mostly here:

So you can set JETPACK_DEV_DEBUG there as well with a sensible default if you’d like.

1 Like

I think the issue here is that you want have define( 'JETPACK_DEV_DEBUG', true); to be set in dev, but not in production so putting it in the application.php file isn’t ideal since its version controlled. To make it Jetpack compatible you could extend the .env file with something like:


and then in your application.php add:


Don’t know if Roots cares about having Jetpack support, but some of the features are nice (monitor, protect, vaultpress, markdown, etc)

I’ll probably extend this to a lot of my projects, so if there is any interest maybe I’ll submit a PR.

That’s why there are environment specific configs. Put it in

Nice, I just started testing out the whole Roots ecosystem because of Trellis so I don’t have it all down yet. You guys are doing great work! Especially love Trellis.

1 Like