Did you know you can use custom PHP extensions on Heroku? Neither did I, cos I can’t find it in the documentation. But you can:
I came across this while searching for a way or workaround to use the MongoDB PECL extension on Heroku (don’t get me started on that…).
If you can’t be bothered checking the link, the summary is this:
- Create a folder in your app called ‘ext’ or similar.
- Copy your extension into this folder.
- Create a php.ini file with the following contents:
extension_dir = "/app/www/ext/" extension=mongo.so