[英]Fatal error class not found on AWS Beanstalk
My Laravel 3.2.14 application works locally. 我的Laravel 3.2.14应用程序在本地运行。 When I upload it to my server I get this:
当我将它上传到我的服务器时,我得到了这个:
-------------------------------------
/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
Is this a problem with my composer autoload file? 这是我的作曲家自动加载文件的问题吗? I get no other inclination of what's happening.
我对其发生的事情一无所知。 I've been working on this for two days and not sure where to go from here :/
我已经工作了两天,不知道从哪里开始:/
I know the comments below your question have told you take vendor/
out of your .gitignore
, but that isn't normal practice. 我知道你问题下面的评论告诉你从你的
.gitignore
取出vendor/
,但这不是正常的做法。 Elastic Beanstalk for PHP actually supports Composer and will automatically run composer install
on your project when you are pushing a new version. Elastic Beanstalk for PHP实际上支持Composer,并且当您推送新版本时,它将自动在您的项目上运行
composer install
。
For this to work, the root of your repo should be the root of the app. 为此,repo的根目录应该是应用程序的根目录。 You should also have
composer.json
and composer.lock
files enabled by your .gitignore
so that when they are pushed, EB knows to download and install your packages. 您还应该使用
.gitignore
启用的composer.json
和composer.lock
文件,以便在推送它们时,EB知道下载并安装您的软件包。
Your vendor/
files are not included when you push to AWS Beanstalk because they're ignored by your .gitignore
file. 当您推送到AWS Beanstalk时,您的
vendor/
文件不会包括在内,因为.gitignore
文件会忽略它们。
You need to include in your git project your composer.json
and composer.lock
to send them on AWS Beanstalk on each update. 您需要在您的git项目中包含您的
composer.json
和composer.lock
以便在每次更新时在AWS Beanstalk上发送它们。
You can run composer to install the dependencies with a configuration like explained here : https://stackoverflow.com/a/17528576/1671377 您可以运行composer来安装依赖项,其配置如下所述: https : //stackoverflow.com/a/17528576/1671377
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.