在Laravel 4项目上更新作曲者时遇到问题
问题描述:
我试图在Laravel 4项目上使用composer update
。它失败并返回如下:在Laravel 4项目上更新作曲者时遇到问题
PHP Fatal error: Call to undefined function Illuminate\Database\Eloquent\class_uses_recursive() in /home/dev.habbocreate.com/bootstrap/compiled.php on line 6416
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined function Illuminate\\Database\\Eloquent\\class_uses_recursive()","file":"\/home\/dev.habbocreate.com\/bootstrap\/compiled.php","line":6416}}Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255
我也曾尝试composer dump-autoload
然后更新,也删除composer.lock
然后vendors
文件夹reupdating
这是我composer.json
文件
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2",
"hisorange/bbcoder": "dev-master",
"orchestra/imagine": "2.2.x",
"teepluss/gateway": "1.x",
"yangqi/htmldom": "dev-master",
"nubs/random-name-generator": "^1.0"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
它告诉我,我需要添加更多的描述,但我敢肯定,如果我创建足够长的句子,它肯定会让我发布。
答
好吧,我终于明白了这个问题。这是因为我有这个在我的要求:
"laravel/framework": "4.2",
,而不是
"laravel/framework": "4.2.*",
即使'转储autoload'和删除文件同样的错误? – Samsquanch
@Samsquanch yep – Ben
在目录中运行任何PHP命令时是否出现此错误?说,'php artisan -v'? – Samsquanch