I know there are a bunch of other questions floating around out there with the same error, such as: Class 'Illuminate\Html\HtmlServiceProvider' not found Laravel 5
我的问题是,我在本地(XAMPP)上遵循了所有建议的步骤来解决这个问题,并且它毫不费力地解决了这个问题.问题出在我什么时候go 部署到我的AWS ubuntu box(Nginx).我遵循了所有通常的指示:http://laravelcollective.com/docs/5.1/html#installation
我的提供者和别名是在我从本地推送git时添加的.也许这个文件应该被忽略,并且在服务器上手动进行更改?
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,
// ...
],
I then manually added:
Begin by installing this package through Composer. Edit your project's composer.json file to require laravelcollective/html.
"require": {
"laravelcollective/html": "5.1.*"
}
And finally, I ran:
composer.phar update
It was running this command that throws the error:
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] ...
I then tried running php artisan clear-compiled, to see if that would do anything, and got:
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
I know my nginx ubuntu environment is not the same as a windows xampp env, but I'm still unsure why following the Laravel-provided instructions for adding this don't seem to working. Would greatly appreciate some advice on this.
干杯