Friday, May 9, 2014

How let BlueMix support PHP?

Default BlueMix support the below four run time environment.So if you want to run some other environment,you might need to use customize buildpack to do this.
Today I will introduce how to run PHP in the BlueMix.
What you need to prepare before building and runing the app ?

a)A BlueMix account
b)Familiarity with the Cloud Foundry cf command-line interface, which you can download directly from the BlueMix site

c)Elementary knowledge of the PHP programming language

1.Write the php code
  <title>PHP Test</title>
 <?php echo '<p>Hello World</p>'; ?>
2.Choose the php buildpack,actually there are many php buildpack provided.The most popular php buildpack is heroku-buildpack-php.You can also try others as well.
3. Use cf command to login into the bluemix,it will let you enter the email and password
cf login -a
4.After log in to your BlueMix account and run this command from the root folder of your application, where appname represents a unique name for your BlueMix-hosted app.I have tested below three buildpack,they both support php,you can pick anyone of three to test it.

cf push myphptest -b --no-manifest --no-start
cf push myphptest -b --no-manifest --no-start
cf push myphptest -b --no-manifest --no-start

Note:you can also write a  manifest.yml to include the BlueMix deploy information.For example:
- name: myphptest
  memory: 256M
  instances: 1
  host: myphptest

So you can use only cf push command to do that.

5.When you deploy sucessfully,you can launch the url,when you see the hello world page,it means your deployment is sucessfully.


  1. I’ve been browsing on-line greater than three hours today, but I never discovered any attention-grabbing article like yours. It is beautiful worth sufficient for me. Personally, if all webmasters and bloggers made good content material as you did, the net will be a lot more helpful than ever before.
    iOS Training in Chennai
    Android Training in Chennai
    php Training in Chennai

  2. BlueHost is ultimately one of the best hosting provider for any hosting services you need.