[英]Deployment failure: Failed opening required '/var/app/ondeck/vendor/autoload.php'
I've come across a problem that I really don't understand.我遇到了一个我真的不明白的问题。 I've developed a local composer package for my Laravel app (based on an existing one that didn't do exactly what I needed it to), and now I can no longer successfully deploy my app to my AWS Elastic Beanstalk instance.我已经为我的 Laravel 应用程序开发了一个本地作曲家 package (基于一个没有完全满足我需要的现有应用程序),现在我无法再成功地将我的应用程序部署到我的 AWS Elastic Beanstalk 实例。
I believe my new local composer package was created correctly: I took the original composer package, moved it to a new folder called "packages" in my Laravel app root.我相信我的新本地作曲家 package 已正确创建:我采用了原始作曲家 package,将其移动到我的 Laravel 应用程序根目录中名为“packages”的新文件夹中。 I added a repositories
entry to my composer.json
that pointed to it:我向我的composer.json
添加了一个指向它的repositories
条目:
"repositories": [
{
"type": "path",
"url": "packages/konsulting/justgiving-api-sdk"
}
]
I then ran composer require konsulting/justgiving-api-sdk @dev
and the local package was installed successfully.然后我运行composer require konsulting/justgiving-api-sdk @dev
并且本地 package 安装成功。 It works locally with no issues.它在本地工作,没有问题。
But now deploy to EB, I get the following error:但是现在部署到 EB,我收到以下错误:
Activity execution failed, because: PHP Warning: require(/var/app/ondeck/vendor/autoload.php): failed to open stream: No such file or directory in /var/app/ondeck/artisan on line 18 PHP Fatal error: require(): Failed opening required '/var/app/ondeck/vendor/autoload.php' (include_path='.:/usr/share/pear7:/usr/share/php') in /var/app/ondeck/artisan on line 18 Activity execution failed, because: PHP Warning: require(/var/app/ondeck/vendor/autoload.php): failed to open stream: No such file or directory in /var/app/ondeck/artisan on line 18 PHP Fatal error : require(): 在 /var/app/ondeck 中打开所需的 '/var/app/ondeck/vendor/autoload.php' (include_path='.:/usr/share/pear7:/usr/share/php') 失败/工匠在第 18 行
(ElasticBeanstalk::ExternalInvocationError) (ElasticBeanstalk::ExternalInvocationError)
What could be causing this issue?什么可能导致此问题? Literally nothing but this composer package (which works locally) is different.从字面上看,除了这个作曲家 package (在本地工作)是不同的。
I've tried composer dumpautoload
and composer update
.我试过composer dumpautoload
和composer update
。
The problem was simple, but confusing.问题很简单,但令人困惑。 I just needed to disable symlinking in repositories {}
.我只需要在repositories {}
中禁用符号链接。
"options": {
"symlink": false
}
Works fine now!现在工作正常!
I had the same issue this comes when you have made lot of changes in the development to the composer file and the environment which you set to deploy has no updates on the composer.当您在作曲家文件的开发中进行了大量更改并且您设置部署的环境在作曲家上没有更新时,我遇到了同样的问题。 First update you deployment machine by updating composer before deploying.首先通过在部署之前更新作曲家来更新您的部署机器。 This will solve your issue这将解决您的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.