问题描述
V2.6.5
在 Heroku 上部署 API 后,我在请求 API 时遇到了 400 错误的错误请求。但我不明白为什么?
我做了什么:
-
在 /api/public 中添加了 .htaccess(通过 composer require symfony/apache-pack 命令)
-
在 Heroku Dashboard 应用设置中定义了 APP_ENV 和 DATABASE_URL
-
在 /api 文件夹内: git init >> git add 。 >> git commit -m "..." >> heroku create >> git push heroku master
这是一个全新的api项目,除了上面描述的步骤我什么都没做。
(一开始我是按照官方api平台文档中的教程使用app.json manifest但是没有考虑到,所以直接在heroku仪表板中进行了配置)
解决方法
在 Procfile 上,只需删除引号 ''
之前:'web: heroku-php-apache2 public/'
之后:web: heroku-php-apache2 public/