沒有找到我知道有一堆漂浮在那裏用了同樣的錯誤的其他問題,如:Class 'Illuminate\Html\HtmlServiceProvider' not found Laravel 5Laravel 5類「集體 HTML HtmlServiceProvider」在AWS上
我的問題是,我已經遵循所有建議的步驟在我的本地(XAMPP)上解決這個問題,並且它毫無問題地解決了這個問題。問題出在當我去部署到我的AWS ubuntu盒子(nginx)時。我遵循了所有通常的說明:http://laravelcollective.com/docs/5.1/html#installation
當我從本地推送了git pull時,我的提供者和別名已被添加。也許這個文件應該被gitignored,並且在服務器上手動進行更改?
Next, add your new provider to the providers array of config/app.php:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
Finally, add two class aliases to the aliases array of config/app.php:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
我然後手動添加:
Begin by installing this package through Composer. Edit your project's composer.json file to require laravelcollective/html.
"require": {
"laravelcollective/html": "5.1.*"
}
最後,我跑:
composer.phar update
它運行此命令拋出錯誤:
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
> php artisan clear-compiled
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
PHP Fatal error: Class 'Collective\Html\HtmlServiceProvider' not found in /usr/share/nginx/html/cbt/vendor/compiled.php on line 6
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Collective\Html\HtmlServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
PHP Fatal error: Class 'Collective\Html\HtmlServiceProvider' not found in /usr/share/nginx/html/cbt/vendor/compiled.php on line
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-auties] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ...
我然後嘗試運行PHP工匠明確編譯d,看是否會做任何事情,並得到了:
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
PHP Fatal error: Class 'Collective\Html\HtmlServiceProvider' not found in /usr/share/nginx/html/cbt/vendor/compiled.php on line 6716
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Collective\Html\HtmlServiceProvider' not found
我知道我的nginx的ubuntu的環境是不一樣的一個窗口XAMPP ENV,但我仍然不能確定,爲什麼下面的Laravel提供的說明加入這似乎並沒有工作。將不勝感激一些建議。
乾杯!
你嘗試'作曲家自卸autoload'? –
不幸的是,這似乎沒有幫助。 – carbide20