My php program is broken up into modules and each module has its own settings. These settings will hardly change, so would it be better to put the settings in a ini file or in a mysql database?
If I go with the ini style then how hard is it to update the ini file?
A simple text file for configuration has several advantages. Most of all you can use a version control system to compare revisions and to list the history of your configuration files. Another advantage is, that you dont need a special tool to write/change configuration settings. Just fire up a text editor (VI that is ;-) )
Static site-wide configuration settings are probably best stored in configuration files (INI or XML). User specific configuration settings (ie. user specified theme, language selection) are probably better stored in a database (though you could just as well store these in uniquely named config files).
As for how hard it is to update the ini file : that will depend on the number of settings you store in it. To make this a bit easier on yourself you could create sections per module, so you can jump to the relevant section and quickly change the config vars.
ie.
[module1]
var1=value1
var2=value2
...
[module2]
varX=valueX
varY=valueY
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With