Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
glide1 committed Dec 30, 2015
2 parents b681d7d + 687b515 commit 94f51d5
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 121 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v4.3.2 Dec 28, 2015
====================

* Add nginx 1.9.9, drop nginx 1.9.7
(https://www.pivotaltracker.com/story/show/110627098)

* Add httpd 2.4.18, drop httpd 2.4.17
(https://www.pivotaltracker.com/story/show/110627098)

v4.3.1 Dec 09, 2015
====================

Expand Down
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Cloud Foundry PHP Buildpack

A buildpack for Cloud Foundry to deploy PHP based applications.
A buildpack to deploy PHP applications to Cloud Foundry based systems, such as a [public cloud provider](https://www.cloudfoundry.org/learn/providers/) or your own instance.


## 30 Second Tutorial

Getting started with the buildpack is easy. With the `cf` command line utility installed, open a shell, change directories to the root of your PHP files and push your application using the argument `-b https://github.com/cloudfoundry/php-buildpack.git`.
Getting started with this buildpack is easy. With the [`cf` command line utility](https://github.com/cloudfoundry/cli) installed, open a shell, change directories to the root of your PHP files and push your application using the argument `-b https://github.com/cloudfoundry/php-buildpack.git`.

Example:

Expand All @@ -20,24 +20,24 @@ EOF
cf push -m 128M -b https://github.com/cloudfoundry/php-buildpack.git my-php-app
```

Please note that you should change *my-php-app* to some unique name, otherwise you'll get an error and the push will fail.
Please note that you should change *my-php-app* to some unique name on your target Cloud Foundry instance, otherwise you'll get a hostname conflict error and the push will fail.

The example above will create and push a test application, "my-php-app", to Cloud Foundry. The `-b` argument instructs CF to use this buildpack. The remainder of the options and arguments are not specific to the buildpack, for questions on those consult the output of `cf help push`.
The example above will create and push a test application, *my-php-app*, to Cloud Foundry. The `-b` argument instructs CF to use this buildpack. The remainder of the options and arguments are not specific to the buildpack, for questions on those consult the output of `cf help push`.

Here's a breakdown of what happens when you run the example above.

- On your PC...
- It'll create a new directory and one PHP file, which calls `phpinfo()`
- On your PC:
- It will create a new directory and one PHP file, which just invokes `phpinfo()`
- Run `cf` to push your application. This will create a new application with a memory limit of 128M (more than enough here) and upload our test file.
- On Cloud Foundry...
- Within Cloud Foundry:
- The buildpack is executed.
- Application files are copied to the `htdocs` folder.
- Apache HTTPD & PHP are downloaded, configured with the buildpack defaults and run.
- Your application is accessible at the URL `http://my-php-app.cfapps.io` (assuming your targeted towards Pivotal Web Services).
- Your application is accessible at the URL `http://my-php-app.example.com` (Replacing `example.com` with the domain of your public CF provider or private instance).

## More Information

While the *30 Second Tutorial* shows how quick and easy it is to get started using the buildpack, it skips over quite a bit of what you can do to adjust, configure and extend the buildpack. The following docs and links provide a more in-depth look at the buildpack.
While the *30 Second Tutorial* shows how quick and easy it is to get started using the buildpack, it skips over quite a bit of what you can do to adjust, configure and extend the buildpack. The following sections and links provide a more in-depth look at the buildpack.

- [Supported Software](#supported-software)
- [Features](#features)
Expand Down Expand Up @@ -68,32 +68,33 @@ The [release notes page](https://github.com/cloudfoundry/php-buildpack/releases)

## Features

Here's a list of some special features of the buildpack.
Here are some special features of the buildpack.

- supports running commands or migration scripts prior to application startup
- supports an extension mechanism that allows the buildpack to provided additional functionality
- allows for application developers to provide custom extensions
- easy troubleshooting with the `BP_DEBUG` environment variable
- Supports running commands or migration scripts prior to application startup.
- Supports an extension mechanism that allows the buildpack to provide additional functionality.
- Allows for application developers to provide custom extensions.
- Easy troubleshooting with the `BP_DEBUG` environment variable.

## Examples

Here are some example applications that can be used with this buildpack.

- [php-info] This app has a basic index page and shows the output of phpinfo()
- [PHPMyAdmin] A deployment of PHPMyAdmin that uses bound MySQL services
- [PHPPgAdmin] A deployment of PHPPgAdmin that uses bound Postgres services
- [Wordpress] A deployment of Wordpress that uses bound MySQL service
- [Drupal] A deployment of Drupal that uses bound MySQL service
- [CodeIgniter] CodeIgniter tutorial application running on CF
- [Stand Alone] An example which runs a stand alone PHP script
- [pgbouncer] An example which runs the pgbouncer process in the container to pool db connections.
- [php-info] This app has a basic index page and shows the output of `phpinfo()`.
- [PHPMyAdmin] A deployment of PHPMyAdmin that uses bound MySQL services.
- [PHPPgAdmin] A deployment of PHPPgAdmin that uses bound PostgreSQL services.
- [Wordpress] A deployment of WordPress that uses bound MySQL service.
- [Drupal] A deployment of Drupal that uses bound MySQL service.
- [CodeIgniter] CodeIgniter tutorial application running on CF.
- [Stand Alone] An example which runs a standalone PHP script.
- [pgbouncer] An example which runs the PgBouncer process in the container to pool database connections.
- [phalcon] An example which runs a Phalcon based application.
- [composer] An example which uses Composer.

## Getting Help

If you have questions, comments or need further help with the buildpack you can post to the [vcap-dev] mailing list. It's a good place for posting question on all of the open source Cloud Foundry components, like this buildpack. Alternatively, if you're using Pivotal Web Services with the buildpack, you could post to the [support forums].
If you have questions, comments or need further help with the buildpack you can post to the [cf-dev](https://lists.cloudfoundry.org/archives/) mailing list. It's a good place for posting question on all of the open source Cloud Foundry components, like this buildpack.

If you are using one of the [many public CF providers](https://www.cloudfoundry.org/learn/providers/), please use their support channels.
## License

The Cloud Foundry PHP Buildpack is released under version 2.0 of the [Apache License].
Expand All @@ -120,8 +121,8 @@ The Cloud Foundry PHP Buildpack is released under version 2.0 of the [Apache Lic

1. Use in Cloud Foundry

Upload the buildpack to your Cloud Foundry and optionally specify it by name
Upload the buildpack to your Cloud Foundry instance and optionally specify it by name

```bash
cf create-buildpack custom_php_buildpack php_buildpack-cached-custom.zip 1
cf push my_app -b custom_php_buildpack
Expand Down Expand Up @@ -164,7 +165,7 @@ Join the #buildpacks channel in our [Slack community] (http://slack.cloudfoundry

### Reporting Issues

This project is managed through Github. If you encounter any issues, bug or problems with the buildpack please open an issue.
This project is managed through GitHub. If you encounter any issues, bug or problems with the buildpack please open an issue.

The project backlog is on [Pivotal Tracker](https://www.pivotaltracker.com/projects/1042066)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1
4.3.2
4 changes: 2 additions & 2 deletions defaults/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"WEB_SERVER": "httpd",
"PHP_VM": "php",
"ADMIN_EMAIL": "admin@localhost",
"HTTPD_VERSION": "2.4.17",
"HTTPD_VERSION": "2.4.18",
"HTTPD_PACKAGE": "httpd-{HTTPD_VERSION}.tar.gz",
"HTTPD_DOWNLOAD_URL": "/httpd/{HTTPD_VERSION}/{HTTPD_PACKAGE}",
"HTTPD_STRIP": true,
"HTTPD_MODULES_PATTERN": "/httpd/{HTTPD_VERSION}/httpd-{MODULE_NAME}-{HTTPD_VERSION}.tar.gz",
"HTTPD_MODULES_STRIP": true,
"NGINX_VERSION": "{NGINX_18_LATEST}",
"NGINX_18_LATEST": "1.8.0",
"NGINX_19_LATEST": "1.9.7",
"NGINX_19_LATEST": "1.9.9",
"NGINX_PACKAGE": "nginx-{NGINX_VERSION}.tar.gz",
"NGINX_DOWNLOAD_URL": "/nginx/{NGINX_VERSION}/{NGINX_PACKAGE}",
"NGINX_STRIP": true,
Expand Down
22 changes: 11 additions & 11 deletions docs/binaries.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## Binaries

To reduce the time it takes for the build pack to run and setup a usable environment, the build pack makes use of precompiled binaries. For general use, these binaries are hosted on S3. If you're running on a public cloud like Pivotal Web Services, you should be able to use these binaries without any problems and you probably do not need to read any further. If you are running in a private environment or if for security reasons, you'd like to compile your own binaries, this document will explain what you need to do.
To reduce the time it takes for the buildpack to run and setup a usable environment, the buildpack makes use of precompiled binaries. For general use, these binaries are hosted on Amazon S3. If you're running on a public Cloud Foundry provider, you should be able to use these binaries without any problems and you probably do not need to read any further. If you are running in a private environment or if for security reasons you'd like to compile your own binaries, this document will explain what you need to do.


### Bundling Binaries With the Build Pack
### Bundling Binaries With the Buildpack

It is possible to bundle the required binaries with the build pack. When doing this, the build pack is self-contained and should have everything it needs to run. This is not possible if you're using a public CF instance that is run by someone else (i.e. Pivotal Web Services), however if you're running a private cloud then you can install the build pack (see `cf create-buildpack`), which is a nice option as the installed build pack is local and will not need to download anything from the internet.
It is possible to bundle the required binaries with the buildpack. When doing this, the buildpack is self-contained and should have everything it needs to run. This is not possible if you're using a public CF provider, but if you're running a private cloud then you can install the buildpack (see `cf create-buildpack`), which is a nice option as the installed buildpack is local and will not need to download anything from the Internet.

Here are the steps you would need to do this.

1. Clone the repository. Check out a release branch, a specific commit or head.
1. Run `BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ cached | uncached ]`. This will download the latest set of binaries and packagae it with the build pack that you have checked out.
1. Run `cf create-buildpack` pointing to the file that was generated in the previous step. This will install the build pack on your private cloud (as long as you have permissions).
1. Now you can `cf push` a PHP application and you no longer need to set the `-b` argument or specify the build pack in your manifest file.
1. Run `BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ cached | uncached ]`. This will download the latest set of binaries and package it with the buildpack that you have checked out.
1. Run `cf create-buildpack` pointing to the file that was generated in the previous step. This will install the buildpack on your private cloud (as long as you have permissions).
1. Now you can `cf push` a PHP application and you no longer need to set the `-b` argument or specify the buildpack in your manifest file.

#### Use a Build Pack Bundle
#### Use a Buildpack Bundle

If you're running your own CF installation, like with PCF or Bosh Lite, you can follow these steps to install a bundled version of this build pack.
If you're running your own CF installation or BOSH Lite, you can follow these steps to install a bundled version of this buildpack.

First, check if there is an existing `php_buildpack` already installed.

Expand Down Expand Up @@ -49,7 +49,7 @@ python_buildpack 5 true false python_buildpack-offline-v1.0.1
php_buildpack 6 false false php_buildpack-offline-v1.0.1.zip
```

Upload your bundled version of this build pack.
Upload your bundled version of this buildpack.

```
$ cf create-buildpack dm_php_buildpack php-build-pack-14.09.10-16.17.43.zip 7 --enable
Expand All @@ -66,13 +66,13 @@ php_buildpack 6 false false php_buildpack-offline-v1.0.1.
dm_php_buildpack 7 true false php-build-pack-14.09.10-16.17.43.zip
```

Now to push an app using the build pack you installed.
Now to push an app using the buildpack you installed.

- don't set the `-b` argument to cf push
- remove `buildpack` from manifest.yml, if it exists
- cf push

Alternatively, push and use the `-b` argument with the name of the build pack. From the example above, that's `dm_php_buildpack`.
Alternatively, push and use the `-b` argument with the name of the buildpack. From the example above, that's `dm_php_buildpack`.


[PyEnv]:https://github.com/yyuu/pyenv
Loading

0 comments on commit 94f51d5

Please sign in to comment.