gpt4 book ai didi

php - 未找到类 'Doctrine\Common\Inflector\Inflector'

转载 作者:行者123 更新时间:2023-12-03 21:30:40 26 4
gpt4 key购买 nike

我正在将 Laravel 项目设置到服务器中,但是当我使用“composer install”时遇到了这个问题。我在本地做了完全一样的,按照相同的教程,我没有这个问题。

我对两者都使用 ubuntu 16.04。

这是我的 composer.json文件。

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"doctrine/dbal": "^2.5",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}

和错误:
PHP Fatal error:  Class 'Doctrine\Common\Inflector\Inflector' not found in /vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php on line 78


[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Doctrine\Common\Inflector\Inflector' not found

laravel 项目没有问题,好像是安装失败了。知道如何添加缺少的类吗?

最佳答案

我通过执行以下操作解决了它:
删除供应商文件夹

rm -rf vendor
重新安装 Composer
composer install

关于php - 未找到类 'Doctrine\Common\Inflector\Inflector',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42943854/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com