I need to execute a function every tot hours, right now I'm doing it manually by going to:
http://www.mywebsite.com/controller/function
is there a way to schedule the execution of this function every four hours for example?
In the best case you should set cron jobs to request that URL every hour using wget or CURL in the *NIX command line:
0 1 * * * wget http://www.mywebsite.com/controller/function
As this URL is accessible publicly secure it with a parameter like http://www.mywebsite.com/controller/function?key=my_secret_key_here
Also take a look at this online service: http://cronless.com/
/usr/local/php /my/path/outside/the/web/tree.php <param>.