WAMP Cron Jobs / Scheduled Tasks
Posted by: nuweb (---.zone3.bethere.co.uk)
Date: November 07, 2008 02:54PM

I can not find Cron Jobs on WAMP? .. So I presume their is none ,this means If I want a script to run every hour I would probably have to use Windows Scheduled Tasks?

How would I go about executeing a PHP Script like so?
Is their a .exe in /wamp/ that I point to or something on those lines?

Any Help Much Appretiated!

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: yfastud (Moderator)
Date: November 07, 2008 03:51PM

there are too many, here are 2
1. php cli script
2. bat w/ win schedule task

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: nuweb (---.zone3.bethere.co.uk)
Date: November 07, 2008 04:12PM

Thanks for the reply.
Where is the PHP CLI in WAMP Server, Im able to find MYSQL Concole thats about it.

How to Use Cron with PHP CLI:
[www.devarticles.com]

-----------------------------

bat w/ win schedule task
... I dont understand this
I presume your on about windows schedualed tasks, and useing this with a bat file in wamp to create a cron job. Any idea where this Bat is in wamp 2.0 ?

Sorry for little understanding, Im a PHP Programmer not soo good with server stuff tbh.

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: yfastud (Moderator)
Date: November 07, 2008 04:45PM

1. if using cli as command, you have to navigate to php folder or add full path to the System variable path; if using as script, you can implement cli in php script and run from browser; the difference is using command has to be at server while using script can be run from anywhere through internet

2. wamp doesn't come w/ bat for cron; you have to create your own :-(

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: nuweb (---.zone3.bethere.co.uk)
Date: November 07, 2008 05:07PM

k.

I downloaded a shell execute (script?) [phpshell.sourceforge.net] then ran command
0 13 * * * D:\wamp\bin\php -f D:\wamp\www\be.php

With no luck unfrotunatly.

Also created a small php script:
<? echo exec('0 13 * * * D:\wamp\bin\php -f D:\wamp\www\be.php'); ?>
It had no output, so not sure if it worked. Fingers Crossed.

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: nuweb (---.zone3.bethere.co.uk)
Date: November 07, 2008 05:48PM

No Luck.
Id of thought Wamp would include a simple cron interface, since they provide stuff like phpmyadmin.
Ill keep google'ing but no sucess.

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: toivo (---.nsw.bigpond.net.au)
Date: November 07, 2008 08:09PM

Hi,

Quote

<? echo exec('0 13 * * * D:\wamp\bin\php -f D:\wamp\www\be.php'); ?>

That script will not run unless you enable short open tags in php.ini. Use the standard <?php instead.

Remove 0 13 * * * from the beginning of your command, that looks like crontab syntax.

As yfastud suggested, you can add the folder of the PHP CLI, in other words the folder where php.exe is stored, to the system variable PATH, to make your scheduled commands simpler. The Windows scheduler works all right and performs the same function as cron in Unix/Linux.

Regards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: pranky27 (---.7.168.122.airtelbroadband.in)
Date: November 19, 2009 07:03PM

Hi,

I have configured cron on wamp and xampp, please check the link to find exact what to do?

[removed by Moderator]



Edited 1 time(s). Last edit at 11/20/2009 01:57AM by yfastud.

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: yfastud (Moderator)
Date: November 20, 2009 02:02AM

pranky27, cron job can be run w/o internet access; however, in your tutor, it has to access through your site and since the users can NOT see the script, it might contain unexpected executions that would damage the users' pc; thus your link was removed sad smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: WAMP Cron Jobs / Scheduled Tasks
Posted by: charles07 (117.253.156.---)
Date: July 03, 2012 07:18AM

guyz,
this is what i did

1.
PHP file

<?php my code goes here ?>

*note if u r using HTTP api/CURL in CLI use `dl("php_curl.dll"winking smiley;`

ths loads curl into cli

2.
now i added php to windows path varible, this can be done from My computer, properties, advanced settings, environment variabled, new

3.
now i created a .bat file, simply open a notepad & type code below and save as myfile.bat

@ECHO OFF
php -f d:\wamp\www\V3\task.php

[www.makeuseof.com]
this wd help u on .bat file

Now create a new scheduled task on windows & call the above ,bat file as source,

that's it enjoy.

Options: ReplyQuote


Sorry, only registered users may post in this forum.