Coder Social home page Coder Social logo

angrynrd / heroku-buildpack-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heroku/heroku-buildpack-php

0.0 1.0 0.0 830 KB

The official PHP buildpack for Heroku.

Home Page: https://devcenter.heroku.com/categories/php

License: MIT License

Shell 95.89% PHP 4.11%

heroku-buildpack-php's Introduction

Heroku buildpack: PHP

php

This is the official Heroku buildpack for PHP applications.

It uses Composer for dependency management, supports PHP or HHVM (experimental) as runtimes, and offers a choice of Apache2 or Nginx web servers.

Usage

You'll need to use at least an empty composer.json in your application.

echo '{}' > composer.json
git add composer.json
git commit -m "add composer.json for PHP app detection"

If you also have files from other frameworks or languages that could trigger another buildpack to detect your application as one of its own, e.g. a package.json which might cause your code to be detected as a Node.js application even if it is a PHP application, then you need to manually set your application to use this buildpack:

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-php

Please refer to Dev Center for further usage instructions.

Development

The following information only applies if you're forking and hacking on this buildpack for your own purposes.

Compiling Binaries

You need an S3 bucket, referenced in bin/compile, to host your own binaries if you want custom ones.

The folder support/build contains Bob build scripts for all binaries and dependencies.

To get started with it, create a Python app (Bob is a Python application) on Heroku inside a clone of this repository, and set your S3 config vars:

$ heroku create --buildpack https://github.com/heroku/heroku-buildpack-python
$ heroku ps:scale web=0
$ heroku config:set WORKSPACE_DIR=/app/support/build
$ heroku config:set AWS_ACCESS_KEY_ID=<your_aws_key>
$ heroku config:set AWS_SECRET_ACCESS_KEY=<your_aws_secret>
$ heroku config:set S3_BUCKET=<your_s3_bucket_name>
$ heroku config:set S3_PREFIX=<optional_s3_subfolder_to_upload_to>

Then, shell into an instance and run a build by giving the name of the formula inside support/build:

$ heroku run bash
Running `bash` attached to terminal... up, run.6880
~ $ bob build php-5.5.11RC1

Fetching dependencies... found 2:
  - libraries/zlib
  - libraries/libmemcached
Building formula php-5.5.11RC1:
    === Building PHP
    Fetching PHP v5.5.11RC1 source...
    Compiling PHP v5.5.11RC1...

If this works, run bob deploy instead of bob build to have the result uploaded to S3 for you.

To speed things up drastically, it'll usually be a good idea to heroku run bash --size PX instead.

If the dependencies are not yet deployed, you can do so by e.g. running bob deploy libraries/zlib.

heroku-buildpack-php's People

Contributors

dzuelke avatar tmaher avatar ryanbrainard avatar technomancy avatar fdr avatar mattgraham avatar stof avatar ddollar avatar phansys avatar mmcgrana avatar martijngastkemper avatar mdz avatar deguif avatar md-5 avatar ptarjan avatar

Watchers

 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.