Code Monkey home page Code Monkey logo

heroku-php-extensions-fork2's Introduction

Heroku PHP Extensions

Pre-built PHP extensions for Heroku that are not included or fully supported by the official PHP buildpack.

The supported PHP versions are 7.3, 7.4, 8.0 and 8.1 on the heroku-18, heroku-20, and heroku-22 stacks.

Checkout the demo app, or browse the S3 bucket.

Usage

Add the platform repository to your Heroku app:

heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://relay.so/heroku/"

If you prefer using the AWS S3 repositories, add the corresponding repository to your Heroku app:

# heroku-18
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://heroku-php-extensions.s3.amazonaws.com/dist-heroku-18-stable/"

# heroku-20
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://heroku-php-extensions.s3.amazonaws.com/dist-heroku-20-stable/"

# heroku-22
heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://heroku-php-extensions.s3.amazonaws.com/dist-heroku-22-stable/"

Next, add any of the extensions to composer.json as you usually would:

composer require "ext-relay:*"
composer require "ext-redis:*"
composer require "ext-swoole:*"
composer require "ext-openswoole:*"
composer require "ext-msgpack:*"
composer require "ext-igbinary:*"

Troubleshooting

See TROUBLESHOOTING.md.

Contributing

Pull requests for additional Heroku stacks, PHP versions, additional extension versions and new extension are welcome.

Development

Before continuing, read and understand the official build instructions.

Set up

# Install Composer dependencies
composer install

# Copy Python requirements
cp vendor/heroku/heroku-buildpack-php/requirements.txt .

# Create environment file
cp .env.example .env

Be sure to set all variables in your newly created .env file.

Dockerfile

Create a custom Dockerfile for heroku-22.

cat vendor/heroku/heroku-buildpack-php/support/build/_docker/heroku-22.Dockerfile > docker/build/heroku-22.Dockerfile
cat docker/heroku-22.Dockerfile >> docker/build/heroku-22.Dockerfile

Build

# Docker build
docker build --pull --tag heroku-22 --file docker/build/heroku-22.Dockerfile .

# Build libraries
docker run --rm -ti --env-file=.env heroku-22 bob build --overwrite libraries/liblzf-3.6
docker run --rm -ti --env-file=.env heroku-22 bob build --overwrite libraries/lz4-1.9.3
docker run --rm -ti --env-file=.env heroku-22 bob build --overwrite libraries/zstd-1.4.9

# Build igbinary
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20200930/igbinary-3.2.7

# Build msgpack
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20200930/msgpack-2.1.2

# Build phpredis
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20200930/redis-5.3.7

# Build relay
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20200930/relay-0.4.4

# Build swoole
docker run --rm -ti --env-file=.env heroku-20 bob build extensions/no-debug-non-zts-20200930/swoole-4.8.11

# Build openswoole
docker run --rm -ti --env-file=.env heroku-20 bob build extensions/no-debug-non-zts-20200930/openswoole-4.11.1

heroku-php-extensions-fork2's People

Contributors

tillkruss avatar kingizzzy 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.