Code Monkey home page Code Monkey logo

cf-php-varnish-buildpack's Introduction

PHP and Varnish in one Cloud Foundry Buildpack

This is a fork of the official Cloud Foundry PHP buildpack and adds Varnish 3.0 to it (and currently also a more current HHVM (3.5.0) than the official buildpack). Read more about the Varnish inclusion and possibilities at docs/varnish.md.

I try to keep it as close as possible to the original buildpack and merge changes from there.

There's also an issue/discussion about including this into the official buildpack. If you're interested in that, head over there.

If you only need Varnish and nothing else, you can also try my much smaller cf-varnish-buildpack.

The following is from the official README.

Cloud Foundry PHP Buildpack

A buildpack for Cloud Foundry to deploy PHP based applications.

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.

Example:

mkdir my-php-app
cd my-php-app
cat << EOF > index.php
<?php
  phpinfo();
?>
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.

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()
    • 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...
    • The buildpack is executed.
    • Application files are copied to the htdocs folder.
    • Apache HTTPD & PHP 5.4 are downloaded, configured with the buildpack defaults and run.
    • Your application is accessible at the URL http://.cfapps.io (assuming your targeted towards Pivotal Web Services).

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.

Supported Software

The release notes page has a list of currently supported modules and packages.

  • PHP Runtimes
    • php-cli
    • php-cgi
    • php-fpm
    • hhvm
  • Third-Party Modules
    • New Relic, in connected environments only.

Features

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

  • supports running commands or migration scripts prior to application startup
  • download location is configurable, allowing users to host binaries on the same network (i.e. run without an Internet connection)
  • 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

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.
  • 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.

License

The Cloud Foundry PHP Buildpack is released under version 2.0 of the Apache License.

Building

The buildpack only supports the two most stable patches for each dependency in the manifest.yml.

  1. Make sure you have fetched submodules
git submodule update --init
  1. Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
  1. Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ uncached | cached ]
  1. Use in Cloud Foundry

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

    cf create-buildpack custom_php_buildpack php_buildpack-cached-custom.zip 1
    cf push my_app -b custom_php_buildpack
    

Supported binary dependencies

The PHP buildpack only supports the two most recent stable patches for each dependency in the manifest.yml.

If you want to use previously supported dependency versions, provide the --use-custom-manifest=manifest-including-unsupported.yml option to buildpack-packager.

Contributing

Find our guidelines here.

Reporting Issues

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

cf-php-varnish-buildpack's People

Contributors

arthurhlt avatar chregu avatar crawsible avatar flavorjones avatar jbcpollak avatar jtarchie avatar karasaj avatar matteodem avatar mhoran avatar rickvdp avatar squeedee avatar styeung avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.