Laravel 工匠优化不创建引导程序/编译

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23018447/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 09:21:16  来源:igfitidea点击:

Laravel artisan optimize not creating bootstrap/compiled

phpoptimizationlaravellaravel-4

提问by Benubird

I used to have a bootstrap/compiled.phpfile. Then I accidentally deleted it, and because for some reason it was in .gitignore, I don't have another copy of it. How do I get it back?

我曾经有一个bootstrap/compiled.php文件。然后我不小心删除了它,由于某种原因它在 .gitignore 中,我没有它的另一个副本。我如何取回它?

I tried running compose dump-autoloadand php artisan optimize, neither of these generated the file. Where does it come from? How do I produce it?

我尝试运行compose dump-autoloadphp artisan optimize,这些都没有生成文件。它从何而来?我如何生产它?

回答by Antonio Carlos Ribeiro

Laravel 4.1+ does not create bootstrap/compiled.phpon development boxes anymore, only in 'production'. Actually Laravel checks if debug mode is onif it is, it will not generate the compiled.php.

Laravel 4.1+ 不再bootstrap/compiled.php在开发盒上创建,只在“生产”中创建。实际上 Laravel 会检查调试模式on是否是,如果是,它不会生成compiled.php。

But you can:

但是你可以:

php artisan optimize --force

To force its creation.

强制其创建。

回答by Farid Movsumov

Switch debug mode to false in app/config/app.phpand run your command again.

app/config/app.php中将调试模式切换为 false并再次运行您的命令。

'debug' => false,