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.
- Clone the app (i.e. this repo)
git clone https://github.com/cloudfoundry-samples/cf-ex-code-igniter cd cf-ex-code-igniter
- 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
- Push it to CloudFoundry.
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.
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.
- The app is pushed & stages.
- Your MySQL service is bound to the app.
- The app droplet is run.
- The db migration scripts execute.
- The app itself starts.
The migration scripts use the technique described here.