I was looking for the best place to set up common PHP options in Symfony project and saw a couple of time that php.yml is being mentioned - but I found that mostly in v1.x documentation, while in v2.x there is no mention of it (or at least I couldn't find it - Symfony search being down for some time doesn't help neither).
The php.yml had nice 'set', 'check' and 'warn' areas where you could fine tune your configuration.
I tried putting the php.yml and setting it up with some options in app/config but it wouldn't work.
Is php.yml abandoned in Symfony 2 and if it is - what would be the next best way to nicely set up PHP options?
As requested, here is a simple sample of php.yml I tried, it's very basic:
## YAML Template.
set:
display_errors: on
error_log: phperror.log
check:
warn:
Edit: Additional explanation of why I abandoned solution like Matteo suggested
When I did it, something strange was going on. I couldn't pinpoint exactly why, so I left it (I try to avoid all uncertainty when it comes to Symfony because life is so short). So, I made "my_own_config.php" in which I have only a simple line:
ini_set("error_log", "c:/wamp/logs/phperror2.log");
In my config_dev.yml, I include it with
- { resource: my_own_config.php }
In my testing controller, I would print
echo '<br>'.ini_get('error_log');
to make sure my settings are really applied & remembered. INITIALLY, when I load the test page for the first time, it would really remember and show the correct new setting, but when I hit F5 after it - it again shows the default, system log. I am running in dev mode all the time. Tried the F5, hard refresh etc, but all of the later calls dropped back down to the default value.
When I'd change my_own_config.php file and resave it - again, the first time after that, my custom setting would be remembered, and on following refreshes it goes away. So, I concluded that some weird Symfony caching takes over and overwrites my custom php config file and abandoned that approach.
If you want to do some external framework setting change, you can organize your settings as described in the Miscellaneous Configuration, as example, you can put your custom settings in a files like:
and include it in your config.yml:
hope this help