If you are on a unix platform you can run the cgi version of php which allows php to be ran from the command line. Then you can add an entry to your crontab which is sometimes in /etc/crontab, which says run the script test.php every five minutes.
The cron is a unix function that allows you to schedule a task to happen at certain times.