I already read dozens of articles and questions/answers on SO and Programmers but I can't understand what config and bootstrap files are, in the context of a web application.

So my questions are :

  • What information should I put in config files?

  • What should my bootstrap process do?

  • How should I call in to my applications code?

closed as unclear what you're asking by Jörg W Mittag, GlenH7, user40980, jwenting, gnat Oct 16 '14 at 13:30

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Oct 14 '14 at 8:09

The config file should contain those settings that might need to change between deployments. Typically, this will be stuff like database locations and credentials, mail server address, etc.
If it is information that depends on the environment where the application runs, then the software should read those values from a config file.

The bootstrap file sits between the webserver (which wants to just invoke a single script) and the many files of your application.
The task of the bootstrap file is to bring the application/framework in a state where it can start handling the requests. This typically means setting up paths/autoloaders so that all relevant files can be located and installing routes so that the controllers can be matched to the URIs they handle and that the parameters can be extracted from the URIs.

Once the setup is done, the bootstrap file will typically call the Router class/function to interpret the received URI and invoke the corresponding controller. In most frameworks, the controller is the first part of your application (as in non-framework code) that gets called.


Well, according to my experience of making a website, config.php is all about the connection on how to connect your database to your website.. MySQL, sql server etc.. bootstrap.php.. Mmm, I think this is a plugin which I found in some website.

Actually, config.php can be call, depends on your php files needed to be connect to a database.

Here's my code of config.php:

$mysql_hostname = "";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "sfac_als";

$link=mysql_connect($mysql_hostname,$mysql_user,$mysql_password) or die(mysql_error());
 $db=mysql_select_db($mysql_database) or die(mysql_error());

In this case, there's my example of config.php, where, you can see the name of database, which you are connecting to.

Not the answer you're looking for? Browse other questions tagged or ask your own question.