running crontab on php file in linux ?

4 views
Skip to first unread message

feroz akbar

unread,
Feb 17, 2014, 1:06:54 AM2/17/14
to xamp...@googlegroups.com
hi friends,i want to set cronjob to run a php file in localhost.

this is what i have tried
crontab -e
//edited the crontab file like below

* * * * * /usr/bin/wget -q localhost/index.php //every one minute

after saving this i tried to open localhost/index in browser but nothing happened after 1 minute,am i wrong?
 please help me

Mritunjay Kumar

unread,
Feb 17, 2014, 3:05:41 AM2/17/14
to xamp...@googlegroups.com
Hi feroz,

* * * * * /usr/bin/php -q /path/to/script.php

Ensure that "path to script" to be absolute url.

Regards,
Mritunjay Kumar


--
Ask New Question from : https://groups.google.com/forum/?fromgroups#!newtopic/xamppdev
 
Create filter of mails from this group http://www.wikihow.com/Create-a-Filter-in-Gmail
---
You received this message because you are subscribed to the Google Groups "PHP Developers' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xamppdev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xamppdev/3bbdb20b-21f4-47f5-a9bd-1a742a7fc1ba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Regards !
Mritunjay Kumar.

Mritunjay Kumar

unread,
Feb 17, 2014, 3:08:17 AM2/17/14
to xamp...@googlegroups.com
Hi feroz,

* * * * * /usr/bin/php -q /path/to/script.php

Ensure that "path to script" to be absolute url.
Like: c:/xampp/htdocs/script.php

Regards,
Mritunjay Kumar

vikas dwivedi

unread,
Feb 17, 2014, 3:08:40 AM2/17/14
to xamp...@googlegroups.com
On Mon, Feb 17, 2014 at 11:36 AM, feroz akbar <feroz...@gmail.com> wrote:
/usr/bin/wget

Hello Firoz,

Can you describe why you used 

/usr/bin/wget

while you are trying to execute php script ?
Please go with Mritunjay solution. 

regards !
vikas dwivedi 
Reply all
Reply to author
Forward
0 new messages