SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: HELP - PHP Timeout - HELP
-
Jun 19, 2005, 13:44 #1
- Join Date
- Jun 2005
- Location
- Portland Oergon
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
HELP - PHP Timeout - HELP
I wrote a nice little news forum in PHP w/MySQL I also wrote a mass mailer for the forum but I just discovered that PHP has a default time limit of 30 seconds. (Live and learn..)
The structure:
The news forum table entries are copied to a merge queue table. The mass mailer uses fsockopen and fputs to send the email.
Question:
Do I need to write something in Java to take the merge queue and send that or how exactly would I go about this?
-
Jun 19, 2005, 14:07 #2
well you can always use the set_time_limit(<int seconds>) to prevent the script from timing out.
-
Jun 19, 2005, 14:22 #3
- Join Date
- Jun 2005
- Location
- Portland Oergon
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by bigduke
1. Not everybody has access to the php.ini file
2. People would have to modify the php.ini file in order to use the script.
3. This would just modify the limitation instead of remove it.
Thanks for the input BigDuke, but that dog ain't going to hunt in the city. I need a real solution but know nothing about the limitations of spawning a bean under php that will operate independant of the php time out limitations and then terminate once the data has been processed. Or even if it is possible.
This is what I am trying to derive or a better way to go about it.
-
Jun 19, 2005, 14:34 #4
- Join Date
- Jun 2005
- Location
- Alkmaar, The Netherlands
- Posts
- 693
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Use ini_set() to modify php.ini values
Also, you can't completely remove it.Turnware MVC - A new barebone, fast and flexible PHP5 framework!
Ruben Knol
Turnware MVC Lead Developer
-
Jun 19, 2005, 16:05 #5
- Join Date
- Jun 2005
- Location
- Portland Oergon
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Ruben K.
set_time_limit() resets the time limit. So it is possible to for instance write a mail server completely in php.
I wrote a little script that counts up through the IP's and looks for open relays and then adds them to a mySQL database. (Just doodling trying to figure out a solution to the mail list timeout without having to send a ton of email each time)
Anyway, the set_time_limit() reset solved my mailing list timeout problem and opens the door to scripts that run forever if needed.
One of the things I love most about PHP is the huge number of included functions. Seems there is a way to do about anything.
One of the other things I love about php, is the community willing to help each other out. Without the community, there would be no php. Hats off to you two gentlemen, you are da bombs!
-
Jun 19, 2005, 17:20 #6
- Join Date
- Jun 2005
- Location
- Portland Oergon
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Addendum to last post
I guess I was wrong...
The server itself (IIs 4) has a timeout of 300 seconds. The afore mentioned function is only relevant if it is below the server timeout. I think there is a way to remove the server timeout but that places me back into the situation I was in, of having a custom install - config. (Bad thing)
Thanks for the help but this is probably going to have to be solved by java.
Using PHP for this aspect of the script is a bit like replacing farmers with ballerinas. The ballerinas are no good for driving a tractors and getting farmers into tights and a little tutu is always more trouble than it was worth. Trust me on that one... :-)
Bookmarks