我想在heroku上託管我的個人網站。我的網站只有html,css和javascript文件,並且我讀到了heroku只部署了用ruby,node,scala,php等編寫的應用程序。因此,我遵循本教程(http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/)並將我的index.html
文件更改爲home.html
,具有以下代碼的index.php
文件:<?php include_once("home.html"); ?>
。505錯誤Heroku部署個人網站
我已經成功地把它推到了heroku,但是當我打開我的應用程序的heroku url時,它給了我一個505錯誤。
下面是我heroku log
:
2015-11-14T02:42:05.497208+00:00 heroku[api]: Deploy 63ae6bd by [email protected]
2015-11-14T02:42:05.497305+00:00 heroku[api]: Release v4 created by [email protected]
2015-11-14T02:42:05.651545+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-14T02:42:05.651555+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-14T02:42:05.820048+00:00 heroku[web.1]: State changed from up to starting
2015-11-14T02:42:08.998026+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-11-14T02:42:09.746422+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2`
2015-11-14T02:42:09.909064+00:00 app[web.1]: Going down, terminating child processes...
2015-11-14T02:42:10.844965+00:00 heroku[web.1]: Process exited with status 0
2015-11-14T02:42:12.439647+00:00 app[web.1]: Starting php-fpm...
2015-11-14T02:42:12.243079+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2015-11-14T02:42:12.435588+00:00 app[web.1]: 4 processes at 128MB memory limit.
2015-11-14T02:42:14.442033+00:00 app[web.1]: Starting httpd...
2015-11-14T02:42:14.672772+00:00 heroku[web.1]: State changed from starting to up
2015-11-14T02:44:38.663711+00:00 heroku[router]: at=info method=GET path="/" host=mywebsite.herokuapp.com request_id=45aae2bd-a6f8-4023-86cf-6aedd5d23882 fwd="138.110.234.184" dyno=web.1 connect=12ms service=2ms status=500 bytes=224
2015-11-14T02:44:38.663113+00:00 app[web.1]: [14-Nov-2015 02:44:38 UTC] PHP Parse error: syntax error, unexpected '?' in /app/index.php on line 1
2015-11-14T02:44:38.663580+00:00 app[web.1]: 10.146.233.83 - - [14/Nov/2015:02:44:38 +0000] "GET/HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
我的大括號是錯誤的。我有「<?php include_once(」home.html「);?<」而不是「<?php include_once(」home.html「);?>」。謝謝! – johnwj
@johnwj *「幷包含一個index.php文件,其代碼如下:'<?php include_once(」home.html「);?>'」* - 您發佈的內容不支持該問題以及您真的在使用。 '<?php include_once(「home.html」); ?<' –