Procfile 被清空迷案
按照初学者课程第八章所讲,到最后一节执行命令上传代码后
$ git push
$ git push heroku master
heroku上网站打不开了
报错提示找不到入口文件:
2020-05-29T07:54:17.450220+00:00 heroku[router]: at=info method=GET path="/" host=warm-tor-46626.herokuapp.com request_id=d4ec1cd5-d9f1-45d2-86d7-818c655c783b fwd="45.58.186.249" dyno=web.1 connect=1ms service=3ms status=403 bytes=363 protocol=https
2020-05-29T07:54:17.451745+00:00 app[web.1]: [Fri May 29 07:54:17.450315 2020] [autoindex:error] [pid 159:tid 140066768770816] [client 10.9.158.174:34562] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
百度没有查到类似的问题,回退到上一个版本正常。怀疑是代码编写过程中有差错。
再git上查版本时,发现根目录下的Procfile文件被清空了。
而且配置内容与入口目录有关。
web: vendor/bin/heroku-php-apache2 public/
感觉蹊跷,恢复这条语句后,测试网站好使了。
这个过程中最大的收获时github上可以对比每个版本代码更改的地方,非常方便发现问题,没有github我不会发现这个问题的。
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: