Question: I have a file "`update.php`" which does some MySQL operations. A cron job executes this file every 5 minutes. Unfortunately, I cannot execute the cron job more often.

So I had the idea that I could add ...

```
<html>
<head>
  <meta http-equiv="refresh"  content="2; URL=<?php echo $_SERVER['SCRIPT_NAME']; ?>" />
</head>
<body></body>
</html>

```

... to the page "`update.php`". Will cron execute the file in a way that the page will refresh automatically? Or will that not happen because there is no client with a browser?

If it the meta refresh has no effect, is there any other possibility to achieve the refreshing of the page?

Thanks in advance!

Answer: 
You can use PHP to call the script...

```
<?php
$script='/path/to/my/php/script.php';

ignore_user_abort(1);
set_time_limit(0);
$php=exec('which php');
while (1) {
    if (file_exists($script)) { exec($php.' '.$script); }
    else { file_get_contents($script); }
    sleep(2);
}
?>

```

The file you give $script needs to exist, otherwise it thinks it's a URL.

It should do the trick.
What you are trying to do it implies user interaction, so what if no client enters into your "page"?

For example Servlets and EJB containers can do it programmatically at container startup what you need, so I suppose that for PHP the only way to accomplish "automatically" cronlike jobs is to make some changes in your Apache source code, obviously only if you are using an housing server.

**A more praticable option not contempling code changes could be some cron script calling directly your page (wget,netcat,etc...) launched during your web server startup**