Connecting Tech Pros Worldwide Forums | Help | Site Map

Questions over questions

Sven Dzepina
Guest
 
Posts: n/a
#1: Jul 17 '05
Hello people,

I have a problem with my ISP! He kills my php script, if they were executed
over 30 seconds.
Can I use some trick to fake a little bit? That I can execute the script
longer!?

Greeting!



John Downey
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Questions over questions


Sven Dzepina wrote:
[color=blue]
> Hello people,
>
> I have a problem with my ISP! He kills my php script, if they were executed
> over 30 seconds.
> Can I use some trick to fake a little bit? That I can execute the script
> longer!?
>
> Greeting!
>
>[/color]
If your ISP doesn't run your script in safe mode, which it most likely
does, then you can set_time_limit(0); for unlimited execution time.
Otherwise there is probably no way to let it run longer.

scott
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Questions over questions



"John Downey" <blah@doesntexist.com> wrote in message
news:8pdib.121103$xx4.20419112@twister.neo.rr.com. ..[color=blue]
> Sven Dzepina wrote:
>[color=green]
> > Hello people,
> >
> > I have a problem with my ISP! He kills my php script, if they were[/color][/color]
executed[color=blue][color=green]
> > over 30 seconds.
> > Can I use some trick to fake a little bit? That I can execute the script
> > longer!?
> >
> > Greeting!
> >
> >[/color]
> If your ISP doesn't run your script in safe mode, which it most likely
> does, then you can set_time_limit(0); for unlimited execution time.
> Otherwise there is probably no way to let it run longer.
>[/color]
I heard a rumour that the sleep() function resets the script execution time
each time it's called. So if you use it in conjunction with a loop you can
reset the script execution time after each cycle.

Not tested tho!


Sven Dzepina
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Questions over questions


Thanks!
My ISP has no safe_mode! =)
"John Downey" <blah@doesntexist.com> schrieb im Newsbeitrag
news:8pdib.121103$xx4.20419112@twister.neo.rr.com. ..[color=blue]
> Sven Dzepina wrote:
>[color=green]
> > Hello people,
> >
> > I have a problem with my ISP! He kills my php script, if they were[/color][/color]
executed[color=blue][color=green]
> > over 30 seconds.
> > Can I use some trick to fake a little bit? That I can execute the script
> > longer!?
> >
> > Greeting!
> >
> >[/color]
> If your ISP doesn't run your script in safe mode, which it most likely
> does, then you can set_time_limit(0); for unlimited execution time.
> Otherwise there is probably no way to let it run longer.
>[/color]


Paulus Magnus
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Questions over questions


"Sven Dzepina" <mail@styleswitch.de> wrote in message
news:3f8978e3$0$25162$9b4e6d93@newsread2.arcor-online.net...[color=blue]
> Thanks!
> My ISP has no safe_mode! =)
> "John Downey" <blah@doesntexist.com> schrieb im Newsbeitrag
> news:8pdib.121103$xx4.20419112@twister.neo.rr.com. ..[color=green]
> > Sven Dzepina wrote:
> >[color=darkred]
> > > Hello people,
> > >
> > > I have a problem with my ISP! He kills my php script, if they were[/color][/color]
> executed[color=green][color=darkred]
> > > over 30 seconds.
> > > Can I use some trick to fake a little bit? That I can execute the[/color][/color][/color]
script[color=blue][color=green][color=darkred]
> > > longer!?
> > >
> > > Greeting!
> > >
> > >[/color]
> > If your ISP doesn't run your script in safe mode, which it most likely
> > does, then you can set_time_limit(0); for unlimited execution time.
> > Otherwise there is probably no way to let it run longer.[/color][/color]

If you were hosting your account on one of my servers and I found you
defeating the 30 second limit I'd be terminating your account as I'd deem
that you'd broken the Acceptable User Policy. The 30 second time limit is to
stop errant scripts running indefinitely and consuming resources needlessly
for the disbenefit of other users. If you get into the habit of turning this
time limit off you'll eventually create one of these scripts. I don't think
it's good programming practice to leave a user with a script running with no
indication that it's working. This is why we normally segment long processes
into smaller chunks and why things like progress bars were invented.

Paulus


Kevin Thorpe
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Questions over questions


> If you were hosting your account on one of my servers and I found you[color=blue]
> defeating the 30 second limit I'd be terminating your account as I'd deem
> that you'd broken the Acceptable User Policy. The 30 second time limit is to
> stop errant scripts running indefinitely and consuming resources needlessly
> for the disbenefit of other users. If you get into the habit of turning this
> time limit off you'll eventually create one of these scripts. I don't think
> it's good programming practice to leave a user with a script running with no
> indication that it's working. This is why we normally segment long processes
> into smaller chunks and why things like progress bars were invented.[/color]

This begs the question.....

How do you run a php process off-line?

I've built a small perl daemon (php too old) which runs php jobs
off-line. Communication is all via a mySQL table and I have a 'job
queue' webpage to keep an eye on how things are going.

I would really like to be able to spawn offline jobs from a web page
though. Something like....
click the link to get your report...
up pops a small browser window with a progress bar
when the progress bar completes the window reloads
with the report
.... but short of being able to fragment the report build process I can't
think how to do it.

John Downey
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Questions over questions


Kevin Thorpe wrote:[color=blue][color=green]
>> If you were hosting your account on one of my servers and I found you
>> defeating the 30 second limit I'd be terminating your account as I'd deem
>> that you'd broken the Acceptable User Policy. The 30 second time limit
>> is to
>> stop errant scripts running indefinitely and consuming resources
>> needlessly
>> for the disbenefit of other users. If you get into the habit of
>> turning this
>> time limit off you'll eventually create one of these scripts. I don't
>> think
>> it's good programming practice to leave a user with a script running
>> with no
>> indication that it's working. This is why we normally segment long
>> processes
>> into smaller chunks and why things like progress bars were invented.[/color]
>
>
> This begs the question.....
>
> How do you run a php process off-line?
>
> I've built a small perl daemon (php too old) which runs php jobs
> off-line. Communication is all via a mySQL table and I have a 'job
> queue' webpage to keep an eye on how things are going.
>
> I would really like to be able to spawn offline jobs from a web page
> though. Something like....
> click the link to get your report...
> up pops a small browser window with a progress bar
> when the progress bar completes the window reloads
> with the report
> ... but short of being able to fragment the report build process I can't
> think how to do it.
>[/color]
Perhaps some nice javascript and flush() if used right.

Closed Thread


Similar PHP bytes