l33t Posted August 8, 2007 Share Posted August 8, 2007 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 More sharing options...
jscix Posted August 8, 2007 Share Posted August 8, 2007 I'm hoping english isn't your first language, but from the sounds of: "it is color reconizing program which i want to be able to browse a certain game", sounds like you might need something like java... Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318749 Share on other sites More sharing options...
l33t Posted August 8, 2007 Author Share Posted August 8, 2007 Ok iam sorry about my bad typing =p, was just doing it fast, and the program is not the problem its rather i can have the server run the program while iam not on the site running it manually thats all. Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318752 Share on other sites More sharing options...
tarun Posted August 8, 2007 Share Posted August 8, 2007 Isn't There Crons (Cron Jobs) For That But I No Nothing About Them ??? And Im No Expert In This Area But Could You Use Exec Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318780 Share on other sites More sharing options...
cooldude832 Posted August 8, 2007 Share Posted August 8, 2007 php can run executables via the exec() function however I don't know how you would "stop it" but you can built that in the executable its self and just set up a cron job to start it. Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318781 Share on other sites More sharing options...
Orio Posted August 8, 2007 Share Posted August 8, 2007 You can kill the program by using the kill command in exec() too (I think =/). Also you should have a look into ignore_user_abort() so you won't have to keep your browser open. Orio. Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318787 Share on other sites More sharing options...
l33t Posted August 8, 2007 Author Share Posted August 8, 2007 Thanks everyone your help was great , well ill start learning php. Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318812 Share on other sites More sharing options...
PC Nerd Posted August 8, 2007 Share Posted August 8, 2007 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 Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318836 Share on other sites More sharing options...
tarun Posted August 8, 2007 Share Posted August 8, 2007 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); ?> Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318838 Share on other sites More sharing options...
l33t Posted August 8, 2007 Author Share Posted August 8, 2007 Awesome, although i gotta get used to asigning the varibles with $ because the last few languages i did i assigned them differently :-\ and the functions look pretty advanced to. btw do the functions in php return values? Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-318919 Share on other sites More sharing options...
Orio Posted August 9, 2007 Share Posted August 9, 2007 Yeah they can if you want, return anything- arrays, integers, strings or nothing. Orio. Link to comment https://forums.phpfreaks.com/topic/63947-php-is-it-capable-of-this/#findComment-319212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.