Re: Starting a background process and reporting failure if applicable
| From: | Jānis Elmeris | Date: | Tue, 18 Aug 2020 10:28:56 +0000 |
| Subject: | Re: Starting a background process and reporting failure if applicable | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327296@lists.php.net to get a copy of this message | ||
Thank you for the library!
otrd., 2020. g. 18. aug., plkst. 11:58 — lietotājs Umberto Salsi (<
salsi@icosaedro.it>) rakstīja:
> janis.elmeris@lv.lv (Jānis Elmeris) wrote:
>
> > I would like to start a PHP script in the background from within another
> > PHP script. I would like to monitor all error cases properly.
>
> "nohup" and "proc_open()" do not work as there is no way to properly
> detach the launched process from the current process. Instead,
> see recipe to start a background process by Colin McKinnon at
>
> http://symcbean.blogspot.it/2010/02/php-and-long-running-processes.html
>
> My implementation based on this idea is the OfflineJob class, where
> a background process can be lauched, an univocal ticket is returned,
> and its current status can be retrieved; stdin can be set and stdout,
> stderr can be retrieved:
>
>
> ÒÂåBjF“”À
> ,AŨHhttp://www.icosaedro.it/phplint/phplint2/doc/stdlib/it/icosaedro/web/OfflineJob.html
>
>
> Regards,
> ___
> /_|_\ Umberto Salsi
> \/_\/ www.icosaedro.it
>
>