Laravel 5 类 'Collective\Html\HtmlServiceProvider' 在 AWS 上找不到
我知道还有一堆其他问题在那里漂浮着同样的错误,例如:类'Illuminate\Html\HtmlServiceProvider'没有找到Laravel 5
我的问题是,我已经按照所有建议的步骤在我的本地(XAMPP)上解决了这个问题,并且它毫不费力地修复了它。问题是当我去部署到我的AWS ubuntu盒子(nginx)时。我遵循了所有通常的说明:http://laravelcollective.com/docs/5.1/html#installation
当我从本地推送的内容进行 git 拉取时,我的提供者和别名已被添加。也许这个文件应该被 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 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 6716
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Collective\Html\HtmlServiceProvider' not found
我知道我的nginx ubuntu环境与Windows xampp env不同,但我仍然不确定为什么遵循Laravel提供的说明添加它似乎不起作用。非常感谢这方面的一些建议。
干杯!