我想在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”); ?<' –