timeout problem in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rei
Forum Newbie
Posts: 13
Joined: Mon Jul 26, 2004 9:51 pm

timeout problem in PHP

Post by rei »

i'm coding a php program which will call a shell script through a button.

program : myprogram.php
shell program to be called myshell.sh

When the button is clicked, myshell.sh is executed, and result is displayed in a textarea in the original php program (myprogram.php)
<FORM METHOD=post ACTION=$_PHP[SELF]>

Now, i'm facing problem that, myshell.sh works for around 3 hours(doing large calculations), and i'm afraid of time out problem with php or apache.

I read on the website that i can set the php.ini to
set_time_limit(0)

Does this means that my php will hang there until the process is being finished?

How about apache time out?

What should i basically do to enable calculation working for 3 hours without any timeout problem occuring?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

set_time_limit is the correct thing to change. I have yet for the server to hang. That depends mostly on the script not taking over 100% of the CPU for that time though. If this needs to be done on a somewhat regular basis, I'd suggest setting up a cron for it.
Post Reply