1. Sign up:
First, go to Heroku.com and click “sign up” to get your free Heroku account.
2. Install the Heroku Toolbelt:
The Heroku Toolbelt contains the Heroku client, a command-line tool for creating and managing Heroku apps.
Install Heroku Toolbelt with command
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
for other platforms check this link:https://toolbelt.heroku.com/
3. Login from Command Line:
After installing the Toolbelt you’ll have access to the `heroku` command set from your command shell.
Authenticate using the email address and password you used when creating your Heroku account.
$ heroku login
Enter your Heroku credentials.
Email:
Password:
4. Prepare your App for Deployment:
Now you’re ready to deploy your app on Heroku!
Execute the following commands to clone the sample application:
$ git clone https://github.com/heroku/php-getting-started.git
$ cd php-getting-started
You now have a functioning git repository that contains a simple application as well as a composer.json file. Make sure you’ve installed Composer (http://getcomposer.org). Heroku uses Composer for dependency management in PHP projects, and the composer.json file indicates to Heroku that your application is written in PHP.
5. Deploy the app:
Create an app on Heroku, which prepares Heroku to receive your source code:
$ heroku create
Now deploy your code:
$ git push heroku master
Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:
$ heroku open
For more details visit this link:https://devcenter.heroku.com/articles/getting-started-with-php#introduction