Laravel 4:致命错误:在 autoload.php 中找不到类“Patchwork\Utf8\Bootup”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24446883/
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:42:45  来源:igfitidea点击:

Laravel 4: Fatal error: Class 'Patchwork\Utf8\Bootup' not found in autoload.php

phpjsonlaravelcomposer-phpfatal-error

提问by michaelsangma

I added "cviebrock/image-validator": "1.0.*"to require sectionof composer.json. After, I ran composer update, I am getting this Fatal error.

我添加“cviebrock /图像验证器”:“ 1.0 *”需要部分composer.json。之后,我运行了composer update,我收到了这个致命错误。

:::ERROR:::

:::错误:::

Fatal error: Class 'Patchwork\Utf8\Bootup' not found in F:\xampp\htdocs\project\
bootstrap\autoload.php on line 46
Script php artisan clear-compiled handling the post-update-cmd event returned wi
th an error



  [RuntimeException]
  Error Output:



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-
dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [
packagesN]

:::END of ERROR:::

:::错误结束:::

:::COMPOSER.JSON Require section:::

:::COMPOSER.JSON 需要部分:::

"require": {
  "intervention/image": "2.*",
  "cviebrock/image-validator": "1.0.*"
},

I need help in rectifying this fatal error.

我需要帮助来纠正这个致命错误。

Thanks & Regards,

感谢和问候,

Michael Sangma

迈克尔·桑玛

回答by Hari K T

This error seems to me like there is no patchwork/utf8package installed.

这个错误在我看来就像没有patchwork/utf8安装包。

See in your vendor folder whether the package exists or add in the require section in your composer.json file: "patchwork/utf8": "1.1.*"and then do composer update.

在您的供应商文件夹中查看该包是否存在或添加到您的 composer.json 文件中的 require 部分:"patchwork/utf8": "1.1.*"然后执行composer update.

回答by Mark Francis

I Solved It With composer dump-autoloadand then composer update

我解决了composer dump-autoload然后composer update

After that it works But if you encounter more issue try to Delete the vendor folder or just rename it fo backup puporse incase it fails like mv vendor vethen

之后它可以工作但是如果您遇到更多问题,请尝试删除供应商文件夹或将其重命名为备份目的,以防它像mv vendor ve那时一样失败

Delete composer.lock

Run the command composer clearcache (or clear-cache) Run composer install

运行命令 composer clearcache (或 clear-cache) 运行 composer install

Your good to go.

你好去。

回答by Victor Lengler

Dude, you just have to do this:

伙计,你只需要这样做:

composer require patchwork/utf8

回答by RN Kushwaha

I was having the same problem because when I run php artisan db:seed --class=PostsTableSeeder

我遇到了同样的问题,因为当我运行 php artisan db:seed --class=PostsTableSeeder 时

it started to remove laravel, symfony etc. I can't understand why?(may be my composer.json included at that time only "require": { "fzaninotto/faker": "1.3.*@dev" },)

它开始删除 laravel、symfony 等。我不明白为什么?(可能只是当时我的 composer.json 包含在内"require": { "fzaninotto/faker": "1.3.*@dev" },

So what I did, I updated my composer.json again and run composer update --dev. composer.json as

所以我做了什么,我再次更新了我的 composer.json 并运行了 composer update --dev。composer.json 作为

"require": {
    "laravel/framework": "4.2.*",
    "way/generators": "~2.0",
    "patchwork/utf8": "1.1.*",
    "fzaninotto/faker": "1.3.*@dev"
},

And that worked because it downloaded again everything.

这很有效,因为它再次下载了所有内容。

回答by Ganesh Jogam

I just commented the 'Patchwork\Utf8\Utf8ServiceProvider' in app.php and it worked

我刚刚在 app.php 中评论了“Patchwork\Utf8\Utf8ServiceProvider”并且它起作用了

回答by Rudy Jessop

I am most certain you pulled your application from a git? If you take a closer look at your .gitignorefile you would see that /vendoris one of the files/folders that git was told to ignore. You need to remove /vendor, composer.lockand composer.pharfrom .gitignoreIFyou're in development.

我很确定你从 git 中提取了你的应用程序?如果您仔细查看您的.gitignore文件,您会发现它/vendor是 git 被告知要忽略的文件/文件夹之一。您需要删除/vendorcomposer.lockcomposer.phar.gitignoreIF你发展是。

Also if you navigate to the /vendorsfolder via FTP or ssh, you will see that it only has folders that were outlined in your composer.json file under

此外,如果您/vendors通过 FTP 或 ssh导航到该文件夹,您将看到它只有在您的 composer.json 文件中列出的文件夹

"require": {

}

are the ones in the vendor folder.

是供应商文件夹中的那些。

Once you run composer updateand composer installyou should be fine.

一旦你跑了composer updatecomposer install你应该没问题。