CloudFoundry PHP example application: CodeIgniter
Clone or download
Keaty and sesmith177 Use latest 2.2.x codeigniter
- because sample app is a 2.2. app


Signed-off-by: Sam Smith <>
Latest commit 14fa7a5 Jan 21, 2017

CloudFoundry PHP Example Application: CodeIgniter

This is an example application which can be run on CloudFoundry using the [PHP Build Pack].

This is the CodeIgniter Tutorial application and it demonstrates push a CodeIgniter applications to CloudFoundry.


  1. Clone the app (i.e. this repo)
git clone
cd cf-ex-code-igniter
  1. If you don't have one already, create a MySQL service. With Pivotal Web Services, the following command will create a free MySQL database through ClearDb.
cf create-service cleardb spark mysql
  1. Push it to CloudFoundry.
cf push

Access your application URL in the browser. You should see the main page and be able to navigate the links. The news section is pulled from the database. Initially it'll be empty, but you can create some news entries with the create page.

Database Details

Previously with this example, it was necessary to create the database manually. Now this happens automatically when you push the application. Here's how this works.

  1. The app is pushed & stages.
  2. Your MySQL service is bound to the app.
  3. The app droplet is run.
  4. The db migration scripts execute.
  5. The app itself starts.

The migration scripts use the technique described here.