You are here: Re: exec() in the background « All PHP « IT news, forums, messages
Re: exec() in the background

Posted by shortbackandsides.no on 02/15/06 13:58

On Mon, 13 Feb 2006 15:30:07 +0000 (UTC), "MS"
<nospamplaesegr8t_ukuk@yahoo.co.uk> wrote:

>In the admin section of my site, I want to be able to run a script which
>will thumbnail thousands of images.
>
>Obviously this will take a little while, so I was wanting to initiate the
>script and have it run in the background so I don't have to wait for it to
>finish.
>
>I have looked at exec() at php.net
>
>Am I looking at the correct command? or is there a better one?
>
>and what would be the correct format for this function?
>
>exec(thumb.php);
>
Couldn't you achieve the same result by initiating thumb.php as a
normal php page i.e. www.example.com/thumb.php then disconnecting the
script from the browser session by (I think...) including near the top
of thumbs.php:

header("HTTP/1.1 200 OK");
header("Content-Length: 0");
flush();

The problem with this (or using the exec function) is that if your
script goes into a loop forever I think the only way to stop it is to
Telnet to the server, find the process and kill it.
I'd like a way of reconnecting to a background script via a browser
.... anyone?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация