mardi 25 août 2015

Execute Laravel/Symfony/Artisan Command in Background

I need to execute a Laravel long running process in the background for consuming the Twitter Streaming API. Effectively the php artisan CLI command I need to run is

nohup php artisan startStreaming > /dev/null 2>&1 &

If I run that myself in the command line it works perfectly.

The idea is that I can click a button on the website which kicks off the stream by executing the long running artisan command (needs to run in the background) which starts streaming. Going via the command line works fine. Calling the command programatically however doesn't work. I've tried calling it silently via callSilent() from another command as well as trying to use Symfony\Component\Process\Process to run the artisan command or run a shell script which runs the above command but I can't figure it out.

Help much appreciated



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Kj3ar3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire