Open URL periodically, without web browser

1k views Asked by At

I have PHP web script that have to be executed periodically, using web browser. My idea was to execute Lynx web browser in scheduled time, but problem is that server where this script is placed does not have Lynx installed.

Is there other ways to achieve this?

Thank you in advance!

1

There are 1 answers

0
Pascal MARTIN On BEST ANSWER

If a simple user-agent that's able to fetch a web page is enough, you could request your URL using curl or wget, from the crontab of your server.

Chances are pretty high that either curl or wget will be installed already.

If none of those two tools is available, another solution would be to write a PHP script that does the fetching (typically, using file_get_contents, or curl), and call that script from the crontab.


Of course, if you do not need an actual HTTP request to be sent/received, the right thing to do is to just directly execute your PHP script from the crontab, not using any kind of user-agent.