Laravel 4类在bootstrap / compiled.php中找不到 [英] Laravel 4 Class not found in bootstrap/compiled.php
问题描述
我使用Git创建了一个新的分支,对我的代码应用了一些更新,检查我的分段服务器上的分支,我现在不能运行任何作曲家相关。
我已经在composer.json中添加了一些新的包,它在我的开发环境中工作,但是一旦我在临时环境中尝试 composer update
我尝试过
composer update
composer dump-autoload
php artisan clear-compiled
php artisan dump-autoload
php artisan optimize
但所有结果都会导致以下错误
PHP致命错误:在线路4321上的
/var/www/sites/x/bootstrap/compiled.php中找不到类'Artdarek\OAuth\OAuthServiceProvider'
脚本php artisan clear-编译处理
pre-update-cmd事件返回一个错误
[RuntimeException]
错误输出:PHP致命错误:Class'Artdarek\OAuth\OAuthServiceProvider'
在第4321行的/var/www/sites/x/bootstrap/compiled.php
中找不到
我还可以尝试什么来获得作曲家下载新文件?
解决方案
php artisan optimize --force
该命令将重新生成
/bootstrap/compiled.php
当您的环境处于调试模式时,需要
- force
arg重新生成文件。I have created a new branch using Git, applied some updates to my code, checked out that branch on my staging server and I now can't run anything composer related.
I've added some new packages to composer.json which work on my development environment, but as soon as I try
composer update
on the staging environment I get class not found errors relating to the classes it's not yet downloaded.I've tried
composer update composer dump-autoload php artisan clear-compiled php artisan dump-autoload php artisan optimize
But all result in the following error
PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider' not found in /var/www/sites/x/bootstrap/compiled.php on line 4321 Script php artisan clear-compiled handling the pre-update-cmd event returned with an error [RuntimeException] Error Output: PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider' not found in /var/www/sites/x/bootstrap/compiled.php on line 4321
What else can I try in order to get composer to download new files?
解决方案php artisan optimize --force
That command will re-generate
/bootstrap/compiled.php
The
--force
arg is needed to re-generate the file when your environment is in debug mode.这篇关于Laravel 4类在bootstrap / compiled.php中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!