开发者

PHP program always active in web-server

Is it possible? E.g. A script every minute write a wo开发者_运维知识库rd in a file (without the page opened in a browser).


Yes, you'd need to set up a cron job that runs regularly (eg: every minute).


You can accomplish this with a cronjob.

Get some detailed info here:
http://service.futurequest.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=30

Plus you might want to ask your hoster how you can add cronjobs on your particular server.


This is kind of job definitely not for web server. The job for web server is to invoke your script on request from the web. PHP engine can run autonomously, without server. You can run it: /usr/bin/php -f yourscript.php, on Windows repace beginning with your php.exe path. Then use cron to schedule execution


You can execute php from the command line, in this case your scripts executes regardless of server/browser, you can use a for loop, combined with sleep to achieve what you described.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜