LoginSignup
7
7

More than 5 years have passed since last update.

Herokuで<?php phpinfo();

Last updated at Posted at 2014-05-11

同内容の記事をTumblrで、コードはgithubで公開しています。

2014年4月29日にHerokuがPHPを公式にサポートを始めたので触ってみました。
phpinfo();を実行するためにした手順は以下の通りです。適当なディレクトリ内で行ってください。

まず、エディタ等でindex.phpと、依存関係を宣言するためのcomposer.jsonを作成します。

index.php
<?php
    phpinfo();
composer.json
{
    "require": {
        "php": "~5.5.0"
    }
}

Herokuにデプロイする際に、現状では"~5.5.0"という緩い設定だと警告が出ますが、無視できるそうです。

gitの初期化からherokuへのプッシュまでを以下のように行います。

$ git init
$ git add index.php composer.json
$ git commit -m 'initial commit'
$ heroku create
$ git push heroku master

これで$heroku open$ heroku createした際に表示されるurlにアクセスすることで動作が確認できます。

参考リンク

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7