Created
November 13, 2012 13:03
-
-
Save Sitebase/4065664 to your computer and use it in GitHub Desktop.
PHP Worker file that restarts after crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker: while true; do cd /app/www/ && /app/bin/php worker.php; sleep 1; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
while (true) { | |
echo 'Hello world at ' . time() . PHP_EOL; | |
sleep(1); | |
} |
For heroku to automatically detect this as a PHP project for it's build-pack, you also need a composer.json
file, even if it's empty (contains {}
).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure if you use this on Heroku to add:
to disable apc in the worker otherwise you'll get some serious caching problems.