I have written php program and uploaded on server. I want run this program infinitely. My programs source is like this:
<?php
while (1<2){
make something;
}
?>
Of course, if i will open this page in my browser it will run, but if i will shut down my pc it will stop working. How i can run this program infinitely without opening in any browser.
Run in commandline or run as a cronjob; you can also check for making a php file a system daemon:
http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/
Using PHP as a daemon allows you to make it run indefinitely, however you might have to reset it at regular intervals to ensure it does not stack memory.
By the way:
does also work.