CloudFoundry PHP example application: CodeIgniter
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bp-config
.extensions/code-igniter
application
images
.cfignore
.gitignore
.htaccess
README.md
index.php
manifest.yml

README.md

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.

Usage

  1. Clone the app (i.e. this repo)
git clone https://github.com/cloudfoundry-samples/cf-ex-code-igniter
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.