Menu Home

A Guide to Using Heroku PHP to Run Hoiio Sample Code

We have provided many PHP sample code in the past, with the most recent being the call forwarding app.

Many developers have webhost providers that support PHP, but we have encountered many developers who wanted to get started with the PHP sample code quickly, yet they don’t have a webhost.

Fortunately, there is always a FREE and GOOD option around – Heroku!

While Heroku does not directly state that they support PHP, they do! This is how you can get started.

1. Register a Heroku account

2. Install the toolbelt

3. Create a project directory e.g. /hoiio-heroku-app

4. Create index.php in the root directory. It can be an empty file, but it MUST be there for Heroku to recognize this as a PHP app.

5. Init git and push. Issue these commands in root directory.

heroku create
git init
git add .
git commit -m "Initial commit"
git push heroku master

6. After pushing to heroku, you will see the URL to your app eg. http://intense-woodlands-1234.herokuapp.com.

7. Use any of Hoiio sample code, for example you can set up auto-attendant to create a Main Line. IMPORTANT: Read the setup instructions for auto-attendant. Your server URL is that you obtained in (6).

8. git push the code again

git add .
git commit -m "Added Hoiio auto-attendant"
git push heroku master

That’s it! Call your Hoiio number and test out!

Categories: API for Developers

Tagged as:

Hoiio

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: