Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cachewerk/heroku-php-extensions
Pre-built PHP extensions for Heroku that are not included or fully supported by the official PHP buildpack.
https://github.com/cachewerk/heroku-php-extensions
heroku php redis
Last synced: 3 days ago
JSON representation
Pre-built PHP extensions for Heroku that are not included or fully supported by the official PHP buildpack.
- Host: GitHub
- URL: https://github.com/cachewerk/heroku-php-extensions
- Owner: cachewerk
- License: mit
- Created: 2021-03-10T00:38:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T18:05:09.000Z (about 1 year ago)
- Last Synced: 2024-12-21T12:36:39.542Z (17 days ago)
- Topics: heroku, php, redis
- Language: Shell
- Homepage: https://php-extensions.herokuapp.com
- Size: 166 KB
- Stars: 28
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Heroku PHP Extensions
Pre-built PHP extensions for Heroku that are not included or fully supported by the official [PHP buildpack](https://github.com/heroku/heroku-buildpack-php).
- [Relay](https://relaycache.com)
- [PhpRedis](https://pecl.php.net/package/redis) (with _igbinary_, _lzf_, _lz4_ and _zstd_ support)
- [Swoole](https://pecl.php.net/package/swoole)
- [OpenSwoole](https://pecl.php.net/package/openswoole)
- [MessagePack](https://pecl.php.net/package/msgpack)
- [igbinary](https://pecl.php.net/package/igbinary)The supported PHP versions are `8.1` to `8.3` on the `heroku-20` and `heroku-22` stacks.
Checkout the [demo app](https://php-extensions.herokuapp.com), or [browse the S3 bucket](https://s3.us-east-1.amazonaws.com/heroku-php-extensions/index.html).
## Usage
Add the platform repository to your Heroku app:
```bash
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:
```bash
# 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:
```bash
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](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](https://github.com/heroku/heroku-buildpack-php/blob/main/support/build/README.md).
### Set up
```bash
# 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
```bash
# 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-20230831/igbinary-3.2.15# Build msgpack
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20230831/msgpack-2.2.0# Build phpredis
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20230831/redis-6.0.2# Build relay
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20230831/relay-0.6.8# Build swoole
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20230831/swoole-4.8.13# Build openswoole
docker run --rm -ti --env-file=.env heroku-22 bob build extensions/no-debug-non-zts-20230831/openswoole-4.12.1
```