On Wed, 21 Jul 2004 10:09:52 -0700, bruce <[EMAIL PROTECTED]> wrote:
>
> 2) i could run the perl script, and have it somehow run in the
> background.... this would ba good, if there's a way to essentially run the
> php script in the background such that it doesn't hang apache.

Do you mean "...to essentially run the PERL script in the background..."

If so you can just use the info in the manual: function.exec.html:

"Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends. "

i.e.

<?php
...
exec("/my/perlscript >> /my/dump.txt 2>&1");
...
?>

This will have your PHP script continuing without waiting for the perl script.

- - -

...If I understood you correctly.

HIH.

Frank



i'd like to
> kick off the php, and have the php/web app return. i could set some form of
> session var to trigger off of when the php is complete..
>
> any thoughts/pointers/etc...
>

AFAIK there's no way to do this. When the request ends (user hits
stop, exit or die called) the process is ended. This includes
children. If you could set it off asynchronously, there would be no
way of knowing when it ended as the process wouldn't have access to
that session any more.

I would suggest setting a value in a table and have a cron job check
for those values, run the script if it's supposed to, then update the
table with the results. Then the PHP script can check the table to see
it it's done.

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to