Endless PHP script not working

Status
Not open for further replies.

zackie

New Member
Messages
4
Reaction score
0
Points
0
Hello.

I have an endless PHP script that seems to stop after about 30s/1m or so.

Here's the script:
<?php
$destsig = 'MSig.png';
$srcn = 1;


for ( ; ; )
{
$srcn = rand(1, 81);
$srcsig = $srcn . ".png";
copy($srcsig, $destsig);

sleep(15);
}

?>

Why does this not work? Is it server related issues?

Thanks in advance.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
You aren't allowed to run scripts for more than n amount of time, as this is free hosting, if everyone would do it the server would die.

This might be doable on a VPS.

If this is to update something, I would suggest using a cron instead. Keep in mind thought that you can only run 1 cron every 5 minutes
 
Last edited:
Status
Not open for further replies.
Top