We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Has anyone had any success deploying to Heroku?

I want to deploy my Phalcon app (a portfolio website) to Heroku but I'm having some difficulties compiling it.

I've tried these buildpacks:
https://github.com/duythien/heroku-buildpack-php
https://github.com/elct9620/heroku-buildpacks-php-with-phalcon (this one is deprecated)
https://github.com/tungnguyenson/heroku-buildpack-nginx-php-phalcon
https://github.com/jstacoder/heroku-buildpacks-php-with-phalcon

I've also tried to create my own buildpack following this tutorial: https://www.sitepoint.com/install-custom-php-extensions-heroku/

Either the deployment fails with the error Failed to resolve runtime requirements [...] (pre-receive hook declined), or it deploys but I recieve an application error when accessing the site with these logs:


2020-07-30T19:24:57.267339+00:00 heroku[web.1]: Starting process with command `sh boot.sh`
2020-07-30T19:24:59.230381+00:00 heroku[web.1]: Process exited with status 1
2020-07-30T19:24:59.265252+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-30T19:24:59.099917+00:00 app[web.1]: Launching apache
2020-07-30T19:24:59.156454+00:00 app[web.1]: httpd: Syntax error on line 150 of /app/apache/conf/httpd.conf: Cannot load modules/libphp5.so into server: libpng12.so.0: cannot open shared object file: No such file or directory

2020-07-30T19:25:38.124832+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=adamh-portfolio.herokuapp.com request_id=8b5dc9d4-96e8-4841-8765-c973d4bd4630 fwd="46.64.118.238" dyno= connect= service= status=503 bytes= protocol=https
2020-07-30T19:25:38.616814+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=adamh-portfolio.herokuapp.com request_id=83271ff0-4bac-479d-8e58-5c3ac5875548 fwd="46.64.118.238" dyno= connect= service= status=503 bytes= protocol=https

Sorry if the solution seems obvious. If not, does anyone have recommendations for other deploy/host options? Preferably one that's affordable.

This doesnt seem anyhow like phalcon issue.

What OS are you use there?

Try to google libpng12.so.0: cannot open shared object file: No such file or directory. You should come to possible solutions to this