在 bootstrap/compiled.php 中找不到 Laravel 4 类 [英] Laravel 4 Class not found in bootstrap/compiled.php

查看:35
本文介绍了在 bootstrap/compiled.php 中找不到 Laravel 4 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Git 创建了一个新分支,对我的代码应用了一些更新,在我的暂存服务器上检查了该分支,但我现在无法运行任何与 composer 相关的东西.

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.

我在 composer.json 中添加了一些新的包,这些包在我的开发环境中运行,但是当我在暂存环境中尝试 composer update 时,我得到与类相关的类未找到错误尚未下载.

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.

我试过了

composer update
composer dump-autoload
php artisan clear-compiled
php artisan dump-autoload
php artisan optimize

但都导致如下错误

PHP Fatal error:  Class 'ArtdarekOAuthOAuthServiceProvider' 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 'ArtdarekOAuthOAuthServiceProvider'
  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

该命令将重新生成 /bootstrap/compiled.php

当您的环境处于调试模式时,需要 --force 参数来重新生成文件.

The --force arg is needed to re-generate the file when your environment is in debug mode.

这篇关于在 bootstrap/compiled.php 中找不到 Laravel 4 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆