by Kevin Schroeder | 12:59 pm

Another question for you.  What do you for configuration management?  Ini files?  PHP Code?  Yml?  Do you have it as part of your deployment process?  Hand-code in production?

And, do you like your configuration management mechanism?



I’m using .ini files, just started a few months ago. Before that my configuration options have been hard coded in PHP code, very bad idea 🙂 Ini files seems good and nice to work.

Mar 10.2011 | 01:23 pm


Am using ini files now, but have used PHP code, and Spring style xml files, though each have their benefits and failure points.

Mar 10.2011 | 01:27 pm

Rahul Prasad

XML, Database

Mar 10.2011 | 01:38 pm


I usually use PHP code, just a config.php file with a $CONFIG array that has all the configuration, sometimes I use ini files, but now I am starting to use json files. Maybe I will need to do some benchmarking in fetching info, from these 3 methods.
But this are all from my side projects/jobs, I haven’t got the chance to use PHP in a company job or at least in a biiig project.

Mar 10.2011 | 01:45 pm


“Configuration Management” means different things to different people.

To some people it means handling the configuration of your application at run time.

To others it means source control.

Mar 10.2011 | 02:01 pm

    Nitin Reddy Katkam

    To me, configuration management could mean:
    * configuration settings of the application (Think appSettings in .NET)
    * configuration settings of the web server, or PHP runtime (Eg. register_globals)
    * Source control, build management
    * Server/network setup and management

    Apr 08.2011 | 01:08 pm


I think it definitely worth to use PHP files (in worst case you var_export your ini file in deploying time) if performance counts. PHP files can be easily bytecode cached with APC (or eAccelerator and company) so reading and processing is much quicker.

Mar 10.2011 | 02:13 pm


I usually write class for my config.

Mar 10.2011 | 02:24 pm


ini files for config files, database for website settings that can be changed by the user.

Mar 10.2011 | 02:49 pm

Gokul Muralidharan

I use xml, due to it’s flexibility to manage it better using eclipse or other xml editors.

Mar 11.2011 | 12:29 am


ini for hard config (db connections etc), there are some usecases for dynamic config which is stored in db. And there is another thing to config management: deployment of the config. DB stored cofnig is obsiusly shared among all the nodes and the ini file is deployed via separete svn repo and some custom made machinery. So any change to the config (turning on and off bits of cache, some default values like page size for pagination, mail config etc) is supervised and trackable and deployed simultanously on all nodes.

Mar 11.2011 | 03:29 am

Laurent Declercq

Well, I uses the application.ini file for general configuration but for convenience reason, I use too some plugin resource classes that allow me to have great control over the configuration.

Mar 11.2011 | 04:38 pm

Thomas Lamy

Depends. For small to medium sized projects I use a php array for db settings, and a generic config class for both application and user settings.
The two big projects i’m working with uses a pretty large ini file for app settings, cached in shared memory. User settings in db, cached with memcache.

Mar 11.2011 | 07:04 pm

Nitin Reddy Katkam

Creating a config.php file where you set variable or constant values is pretty much the standard for PHP applications. For .NET applications, there’s App.config or Web.config.

Apr 08.2011 | 01:05 pm

Leave a Reply

Your email address will not be published. Required fields are marked *