1

i have a php file named "name.php which i want to run in every 5 minutes. I want to use crontab for this function. I have found a lot of tutorial but those all are really confusing to me. Everyone seems to use a crontab file and write like so ...

*/5 * * * * wget http://www.domainname.com/cronfile.php

but i really did not get it. Suppose i have a domain name "www.mydomain.com", so if i create a php file name.php how it be directed by www.mydomain.com/name.php.

Can anyone describe shortly how i should run my php file using crontab or wget. i am running my project in symfony.

Istiak Mahmood
  • 2,330
  • 8
  • 31
  • 73

1 Answers1

1

(I'd comment if I had enough reputation to clarify if you are running the file locally - but I think that you are.)

Here's now I do it:

*/5 * * * * /usr/bin/php /home/user/cronfile.php
  • i actually have done that, but it doesn't work. i am confused, do i need to run wget or cron, in order to work this method, if so how should i do that ... – Istiak Mahmood Jun 23 '15 at 20:39
  • Can you run the script manually from the command line? you may need php-cli installed. – Gregory Hart Jun 23 '15 at 20:44
  • when i try to run like localhost:8000/name it shows permission denied because before it should run it always need to login... – Istiak Mahmood Jun 23 '15 at 20:49
  • What OS are you running this on? Are you able to run this script from the shell? Mine doesn't use the web at all, just runs from the command line. Like a shell script. – Gregory Hart Jun 23 '15 at 20:52