Re: [PHP] PHP running Python script - not waiting for Python script to finish

2009-06-09 Thread Per Jessen
Adrian Price-Whelan wrote:

 Hey -
 
 Running these on a Linux server with PHP 5 and Python 2.5.
 
 My problem is this: I have a simple php form that executes a long (~3
 minutes) Python script using the 'exec' function from php. The issue
 is that the browser, I think, 'times out' before the Python script is
 finished and therefore kills Python and displays no output from
 Python. After some intense googling, I haven't found an answer, 

Can't you just change whichever timeout it is that terminates your
script?


/Per

-- 
Per Jessen, Zürich (17.2°C)


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



Re: [PHP] PHP running Python script - not waiting for Python script to finish

2009-06-09 Thread Robert Cummings



Per Jessen wrote:

Adrian Price-Whelan wrote:


Hey -

Running these on a Linux server with PHP 5 and Python 2.5.

My problem is this: I have a simple php form that executes a long (~3
minutes) Python script using the 'exec' function from php. The issue
is that the browser, I think, 'times out' before the Python script is
finished and therefore kills Python and displays no output from
Python. After some intense googling, I haven't found an answer, 


Can't you just change whichever timeout it is that terminates your
script?


set_time_limit( 600 );

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



[PHP] PHP running Python script - not waiting for Python script to finish

2009-06-08 Thread Adrian Price-Whelan

Hey -

Running these on a Linux server with PHP 5 and Python 2.5.

My problem is this: I have a simple php form that executes a long (~3  
minutes) Python script using the 'exec' function from php. The issue  
is that the browser, I think, 'times out' before the Python script is  
finished and therefore kills Python and displays no output from  
Python. After some intense googling, I haven't found an answer, but I  
found a potential solution that I really want to avoid (manually  
opening a process that runs in the background, and checking its status  
until it is complete, then refreshing the web page). I'd much rather  
find an easier way to do this, and thus I am asking for help either  
way. If my only option is to open a job and monitor its status, could  
someone help guide me through coding this? I've tried naïvely doing  
exec(/path/to/executable arg1 arg2  /path/to/logfile 21 ) but  
it seems as though even this dies when the browser times out. Thanks!


-Adrian