0

It is possible to run continuous PHP applications on free Heroku? I run the PHP irc bot via browser by this code:

<?php
exec("(cd php-irc;/app/php/bin/php ./bot.php bot.conf &) > /dev/null 2>/dev/null &");
?>

Bot turns off after about an hour :(

Milek7
  • 157
  • 1
  • 10
  • Have you looked at background jobs? https://devcenter.heroku.com/articles/background-jobs-queueing – jszobody Jan 17 '14 at 13:39
  • It's looks bit complicated and no tutorials for PHP but I'll try it. It is working on free heroku? – Milek7 Jan 17 '14 at 13:44

1 Answers1

1

As suggested jszobody I use background jobs. I executed

heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib

and created Procfile with contents:

web: sh boot.sh
worker: cd ~/php-irc/ && php bot.php bot.conf

and executed:

heroku ps:scale web=0 worker=1

Seems it works without problems. Thanks!

Milek7
  • 157
  • 1
  • 10