After changes to development/php.yml what command do I use to update?

Hi there,

Am using Trellis and am trying to switch from showing warnings in my local dev environment to just showing errors.

Have updated group_vars/development/php.yml and then ran “vagrant provision”.

There was a failure with a plugin update so not sure if that interferred, but am I barking up the right tree here with trying to switch off warnings and just show PHP errors?

Also tried running “ANSIBLE_TAGS=php vagrant provision”

Either command you tried should work. There are some php settings also involved in dev.yml's two wordpress roles, so if running with tags after adjusting php configs, you could do the following just to be safe:
ANSIBLE_TAGS=php,wordpress SKIP_GALAXY=true vagrant provision

If the playbook failed after adjusting the php ini file via the php role, the playbook may not have run the “reload php” handler at the end. You could reload php manually to make sure the changes to the ini file take effect:

vagrant ssh
sudo service php7.1-fpm reload
sudo service nginx reload

You may also want to adjust your WP_DEBUG setting in Bedrock.

1 Like

Thanks Phil,

Have tried those commands, but weirdly still see the warnings on my dev machine…

The vagrant provision command seemed to work ok. Scratching my head a bit on this one.


I assume the warnings are caused by third-party code you cannot fix on your own. Frustrating.

Have you addressed the DEBUG settings in Bedrock development env?

You could comment out everything in group_vars/development/php.yml and reprovision, checking whether this issue is due to settings specific to the development environment.

You could check that php_info output shows your desired values for settings related to displaying warnings.

You could create a staging site to check whether the same warnings still show up. If they show, then it apparently isn’t due to dev vs. staging environment, nor due to the specific settings in group_vars/develoment/php.yml.

Any chance the display of these particular warnings is not affected by php settings? I imagine you’ve widely researched these specific warnings and how to suppress them.

Yes, they’re being generated primarily by one plugin that I’m trying to add customisation hooks to.

Am not using Bedrock on this project, so I don’t think that debug setting is relevant.

I actually do have a staging site: and they don’t show up there even with the same plugin version and stuff. Assumed it was due to different php settings. There’s no php.yml in the staging group vars (at least on my project).

Haven’t “widely researched” the warnings. They’re a bit esoteric… but I think they’re displayed due to poor error handling in the plugin.

The full set of php settings available for you to configure in Trellis can be viewed in the defaults for the php role (and a few in the wordpress-setup role).

The group_vars/development/php.yml file is an example of overriding some defaults. Staging and production use the defaults and thus don’t have any overriding group_vars/<env>/php.yml files.

Ok you’re not using Bedrock. The only php differences I can think of that Trellis makes for development are in that group_vars/development/php.yml file. Could you try commenting out all those configs and rerunning the vagrant provision? Then the Trellis-controlled php configs should be the same for your dev and staging.

Any other differences between dev and staging would probably be in your own custom code, as far as I know. You might double-check your own settings for WP_DEBUG etc. Maybe also compare relevant php_info output from dev vs. staging.

Ok. If the above steps don’t help, just be sure you’ve researched these warnings enough to support the assumption that their display is a matter of settings in php (vs. something else).

Yay, thanks Phil. Removing the settings in php.yml and re-running vagrant provision helped. The plugin is now actually more or less working in dev. Still getting one warning, but it’s largely unobtrusive compared to what I was seeing before.

Really appreciate your great support! :slight_smile:

1 Like