问题描述
安装Passport适用于Laravel Vapor的本地环境。但是在将其部署到生产环境后,发生了错误:
搜索错误消息后,似乎我们需要像提到的here一样运行PHP artisan passport:install
。
我们如何使用Laravel Vapor做到这一点?有没有办法通过ssh
访问服务器?
解决方法
Vapor没有永久文件系统;每个HTTP请求都会命中一个新的Lambda实例。
文档have some info on deploying Passport keys。在Vapor上,最好的选择是使用Vapor的“秘密”系统将其放入环境中,然后执行以下操作:
php artisan vendor:publish --tag=passport-config
然后将提供从环境变量中加载加密密钥的选项:
您需要在Vapor中命名您的秘密PASSPORT_PRIVATE_KEY
和PASSPORT_PUBLIC_KEY
。