我的Laravel 3.2.14应用程序在本地运行。当我将它上传到我的服务器时,我得到了这个:
-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Tue May 06 07:35:55.995408 2014] [:error] [pid 25701] [client 174.31.190.151:57098] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 07:35:56.184608 2014] [:error] [pid 25703] [client 174.31.190.151:57099] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 07:40:11.514372 2014] [:error] [pid 25705] [client 174.31.190.151:57103] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 07:40:11.704632 2014] [:error] [pid 25706] [client 174.31.190.151:57104] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 10:18:36.676282 2014] [:error] [pid 25707] [client 185.4.227.194:40880] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 10:54:08.718764 2014] [:error] [pid 25701] [client 115.239.248.56:4697] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 13:39:02.024516 2014] [:error] [pid 25703] [client 173.244.215.194:56452] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
[Tue May 06 13:47:31.401996 2014] [:error] [pid 25705] [client 122.226.223.83:4460] PHP Fatal error: Class 'Symfony\\Component\\HttpFoundation\\LaravelRequest' not found in /var/app/current/laravel/core.php on line 157
这是我的作曲家自动加载文件的问题吗?我对其发生的事情一无所知。我已经做了两天了,不知道从哪里开始:/
答案 0 :(得分:1)
我知道您问题下面的评论告诉您从vendor/
中取出.gitignore
,但这不是正常做法。 Elastic Beanstalk for PHP实际上支持Composer,并且当您推送新版本时,它将自动在您的项目上运行composer install
。
为此,您的仓库的根应该是应用的根。您还应该composer.json
启用composer.lock
和.gitignore
个文件,以便在推送时,EB知道下载并安装您的软件包。
答案 1 :(得分:1)
当您推送到AWS Beanstalk时,您的vendor/
文件不会被包含,因为.gitignore
文件会忽略它们。
您需要在git项目中包含composer.json
和composer.lock
,以便在每次更新时在AWS Beanstalk上发送它们。
您可以运行composer来安装依赖项,其配置如下所述:https://stackoverflow.com/a/17528576/1671377