Jump to content

PHP is it capable of this??


l33t

Recommended Posts

Hi, iam abit of a nub at web site related stuff, iam however a advanced c programmer and i want to no before i decide to learn if php is capable of something iam gonna do. The thing is i want to upload a application on a web sever and i want it to run for a certain amount of time even while iam not on the site, it is  acolor reconizing program which i want to be able to browse a certain game... iam sure you no what iam getting at now. But is php capable of this? is the web server capable of running while no one is on the site just like a application on platform?  ??? i really need some help from a pro please.

Link to comment
https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/
Share on other sites

remember that if a script or program exceeds your hosts limits, that can cuase trouble.  so its fine to simply run the script while are away from that domain, however youll need to limit how long it runs for, and how much CPU its taking up, most hosts have very strict limits on this

I Don't No If This Helps But I Found This Bit Of Code

 

If you want to simulate a crontask you must call this script once and it will keep running
forever (during server uptime) in the background while "doing something"
every specified seconds (= $interval):


<?php
ignore_user_abort(); // run script in background
set_time_limit(0); // run script forever
$interval=60*15; // do every 15 minutes...
do{
   // add the script that has to be ran every 15 minutes here
   // ...
   sleep($interval); // wait 15 minutes
}while(true);
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.