简体   繁体   中英

PHP Heroku background workers?

I'm using Heroku running a PHP app, I need to setup background workers which talk to external APIs and write to my DB, Heroku has lots of info about setting up workers for Ruby but not for PHP.

Is this easily doable on Heroku with PHP?

I've never tackled launching background processes and I can't seem to find any docs detailing it...

Add the following environment variables:

# Add this config
$ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib

Then you can just add the worker to your Procfile.

worker: cd ~/www/ && ~/php/bin/php worker.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM