Symfony 2 – What’s the use of bootstrap.php.cache file?

When you grab a Symfony 2 project, maybe you have already faced this kind of error:

Unable to find bootstrap.php.cache file...

To resolve this error, you must first know what is the purpose of bootstrap.php.cache file.

This file like its name is a bootstrap file, it contains all class definitions of the framework in a single file.

Why?

Just because loading multiple classes in different directories in a single request uses lot of resources. Instead of that all these classes are called from a single file called bootstrap.php.cache.

This file needs to be updated at each modification of a core or thrid party file of the framework.

How to get rid of this error?

Simply update or reinstall your composer vendors, or target this file from your console:

php ./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

That’s all, hope you saved some time with this.

Advertisements
Symfony 2 – What’s the use of bootstrap.php.cache file?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s