I am using continuous deployment with jenkins on AWS. Everything is OK, but when I look on my page, there is this error:
Warning: require_once(/var/app/web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/app/web/app.php on line 6 Fatal error: require_once(): Failed opening required '/var/app/web/../app/bootstrap.php.cache' (include_path='.:/usr/local/lib/php') in /var/app/web/app.php on line 6
I know, it's because I miss bootstrap.php.cache which should be generated by composer, but there is nothing.
In dockerfile I use RUN composer install --no-scripts --optimize-autoloader
and in entrypoint I have composer run-script post-install-cmd --no-interaction
Execute following command:
sudo php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
A late comment but :
The boostrap.php.cache
file is generated by a hooks the composer.json scripts section. More specifically :
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
When running the composer install with the --no-scripts
those hooks are not executed.
However, this file is being generated for performance. As is not as relevant to later versions of PHP. You could simply remove it.
Search for "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
your composer.json
if it exists there probably you just need to run 'composer install',
or easiest solution is try to run on sf >= 3
php vendor/sensio/distribution-bundle/Resources/bin/build_bootstrap.php
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