Questions over questions – PHP

  php

Q(Question):

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!

A(Answer):

Sven Dzepina wrote:

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!

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.

A(Answer):

"John Downey" <bl**@doesntexist.com> wrote in message
news:8p***********************@twister.neo.rr.com. ..

Sven Dzepina wrote:

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!

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.

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!

A(Answer):

Thanks!
My ISP has no safe_mode! =)
"John Downey" <bl**@doesntexist.com> schrieb im Newsbeitrag
news:8p***********************@twister.neo.rr.com. ..

Sven Dzepina wrote:

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!

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.

A(Answer):

"Sven Dzepina" <ma**@styleswitch.de> wrote in message
news:3f***********************@newsread2.arcor-online.net…

Thanks!
My ISP has no safe_mode! =)
"John Downey" <bl**@doesntexist.com> schrieb im Newsbeitrag
news:8p***********************@twister.neo.rr.com. ..

Sven Dzepina wrote:

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!

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.

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

A(Answer):

> 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.

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.

A(Answer):

Kevin Thorpe wrote:

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.

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.

Perhaps some nice javascript and flush() if used right.

LEAVE A COMMENT