duangai1941 2016-12-14 19:42
浏览 30
已采纳

heroku上的Symfony部署指向app文件夹

I am trying to deploy the symfony app on heroku and I am able to update the schema and all perfectly fine however when i try to access the site I get

Forbidden You don't have permission to access / on this server.

So using the command heroku logs --num 10 i can see the error

Cannot serve directory /app/web/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive

As you can see heroku is trying to access /app/web/ rather than just web, because of this even my assets are being access via app/web/css which is ofcourse wrong.

So how can i get rid of this app? I do not understand why Heroku is even pointing at that.

I have gone through the steps mentioned in Symfony documentation over and over and I cant seem to find out what I am missing?

The Procfile seems to be point to web so where is this app coming from?

web: vendor/bin/heroku-php-apache2 web/

I have gone through other articles online like the one as following but nothing seems to be fixing my problem.

Symfony on Heroku: 403 Forbidden You don't have permission to access / on this server

Any help will be really appreciated.

  • 写回答

2条回答 默认 最新

  • dos49618 2016-12-21 05:32
    关注

    On Heroku you need to create the .Procfile and upload that or create the app.json Schema file and then based on that Heroku will create the .Procfile for you automatically, here you can see the app.json example for Symfony app.

    Another thing that needs to be crossed checked is make sure in your public directory the .htaccess file was also uploaded. In Symfony the public directory is the web folder and in my case the .htaccess file was missing.

    After making sure of the above two steps my app works perfectly fine on Heroku.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况