【台灣百岳】帶山友爬百岳的一些照片~玉山、雪山、嘉明湖、奇萊連峰、南湖大山、武陵四秀、合歡群峰

圖片
彙整紀錄一下過去帶團的一些記錄。 ▼▼▼2020年玉山主峰_研究所同學團▼▼▼ ▼▼▼2020年玉山主峰台灣團▼▼▼ ▼▼▼2020年玉山主峰台灣團▼▼▼ ▼▼▼2020年玉山主峰台灣團▼▼ ▼▼▼2020年玉山主峰台灣團▼▼▼ ▼▼▼2019年玉山主峰台灣團▼▼▼ ▼▼▼2019年玉山主峰台灣團▼▼▼ ▼▼▼2019年玉山主峰台灣團▼▼▼ ▼▼▼2019年玉山主峰台灣團▼▼▼ ▼▼▼2019年玉山主峰香港團▼▼▼ ▼▼▼2019年玉山主峰台灣團▼▼▼ ▼▼▼2019年雪山主峰澳門團▼▼▼ ▼▼▼2019年玉山香港團▼▼▼ ▼▼▼2019年玉山香港團▼▼▼ ▼▼▼2019年玉山香港團▼▼▼ ▼▼▼ 嘉明湖團(含登頂三叉山、向陽山) ▼▼▼

Running PHP application on Heroku (Mac OS X)


Heroku is a very popular PaaS (Platform as a Service) cloud hosting service which allows you to deploy various applications, especially Ruby on Rails application. Heroku doesn't charge anything to sign up and has a free service upto 5 MB usage of PostgreSQL database, that's enough to used for your development environment. Heroku is majorly to Deploy Ruby on Rails, Node.js, Java, Clojure and Django apps, but you can also run any type of app (like PHP).

The PHP support was launched in partnership with Facebook, to attract Facebook application  developers to Heroku's cloud platform (Heroku support PHP). In this post, you will learn how to deploy PHP project on Heroku. I assume that you already signed up with Heroku and configured your SSH keys with Heroku servers. If you haven't done it already, follow these instructions.

You can try it out for yourself by just creating a new project folder with an index.php file in it, then creating a Heroku project. When you push to Heroku, they'll automatically identify it as PHP and compile/install Apache and PHP into your slug.

$ mkdir PROJECT_NAME
$ cd PROJECT_NAME
$ git init
$ git add .
$ git commit -m "Initial commit"

Go to github.com and create a new repository

$ git remote add origin git@github.com:YOUR_USER_NAME/PROJECT_NAME.git
$ git push origin master

Installing the heroku command line client:
If you are using a Mac, install the following version of the heroku command line client (toolbelt). http://toolbelt.herokuapp.com/osx/download

Creating an application on heroku is easy, you just need to run the following command:

$ heroku create PROJECT_NAME --stack cedar

Heroku uses PostgreSQL as its default database but also support MySQL. You can use either Heroku's Postgres-based shared DB storage or a cloud-hosted MySQL like Amazon RDSClearDB MySQL Database or Xeround Cloud DB for your PHP apps on Heroku. (Amazon RDS is a service that allows you to set up, operate and scale a dedicated MySQL database server on top of EC2. You can use Amazon's Relational Database Service (RDS) addon on Heroku.)

$ heroku addons:add shared-database:5mb

Retrieve the database credentials by following command:

$ heroku config

Now, the fun part – push the modified code up to Heroku with git push heroku master:

$ git push heroku master

The output should look something like this:

If you get this error below, make sure the index.php file is under your project folder, and run the command: $ git add .

Setting up database:

I'm familiar with MySQL database, that why I'm choosing ClearDB MySQL database with FREE plan. Run the following command to install the addon:

$ heroku addons:add cleardb:ignite
$ heroku config

$ heroku config:add DATABASE_URL=mysql://db_user:password@db_server/db_schema

How do I import a MySQL dumpfile into the database?

$ mysql -u db_user -p -h db_server db_schema < db_dump_file.sql

Now you can login to mysql server from unix shell or GUI tool (like MySQL Workbench) to check your database.

Finally, you may want to change the database setting in the PHP project. (For this example, I have to configure my config.class.php file)

After that, run the following command:

$ git commit -am "Changed db setting to MySQL"
$ git push heroku master

Congratulations! you've just created your PHP application on Heroku. :)
or just run "$ heroku open"

You can use the "$ heroku logs" command to retrieve this log stream (in streaming mode if you add the –tail options).

Heroku Documentation:


Have fun!

熱門文章

[轉載] 洛克菲勒寫給兒子的38封信(全文)

Jun 24~25, 2022【南橫三星】庫哈諾辛山+【南臺首嶽】關山(進涇橋登山口)|2天1夜野營登山

Aug 21, 2022【新北烏來】紅河谷越嶺古道前段健行。平緩好走的林蔭休閒步道

【美國加州】加州一號公路自駕遊~Half Moon Bay、17 Mile Drive、Bixby Greek Bridge、Big Sur、McWay Falls、Elephant Seal Rookery

Sep 17, 2022【新北烏來】離台北最近的淨土。桶後林道全程24.7公里徒步健行|桶後溪的美景就是看不膩

Sep, 2021【苗栗南庄】蓬萊林道Off Road小試|雨後很爛很濕滑|二傳低底盤車勿輕易嘗試

Mar 12, 2022【重機一日遊】走北橫至宜蘭,經梨山、武嶺下埔里,再走台三線回桃園|16小時的半圈環島

Mar 2023【新北雙溪】淡蘭古道中路健行|雨後獨行中坑古道尋幽(中坑橋~中坑頭鞍部福安宮)

September, 2012 白姑大山二天一夜~其實沒那麼累,只是路途遙遠

Nov 20, 2022【新北烏來】信賢步道健行~輕鬆好走的生態步道,還可順遊內洞森林遊樂區

文章列表

聯絡我

名稱

以電子郵件傳送 *

訊息 *