Cron a php file

nnCron and nnCron LITE discussion

Cron a php file

Postby eksob » Tue, 15 Aug 2006, 08:09

I have XAMPP installed (running php + apache) on my machine. I have been messing around with the lite version, and I am impressed.

I searched through the forums and tried everyone's recommendation to run a PHP file without any success, can someone help me out?

cron.tab
* * * * * C:\Program Files\xampp\php\php.exe file.php

log file

01:03:52 1860 Start nnCron
01:03:52 1860 Load cron.tab
01:04:00 3892 Start: C:\Program Files\xampp\php\php.exe file.php
01:04:00 3892 Start result: 0
01:05:00 4084 Start: C:\Program Files\xampp\php\php.exe file.php
01:05:00 4084 Start result: 0
01:05:33 4092 Service stopped.

file.php
Code: Select all
<?
fopen('http://localhost/website/shutdown.php');
?>


let me know if you need anything else.

Thanks in advance
eksob
 
Posts: 2
Joined: Tue, 15 Aug 2006, 08:06

Postby eksob » Tue, 15 Aug 2006, 16:29

I figured it out...

command prompt won't read 'Program Files' because of the space.

so i copied php.exe, and php5ts.dll to a seperate directory: C:/php

then run the command, in cron.tab:
* * * * * C:\php\php.exe C:\php\file.php
eksob
 
Posts: 2
Joined: Tue, 15 Aug 2006, 08:06

Postby Valery_Kondakoff » Tue, 15 Aug 2006, 16:55

I'm not sure about this. nnCron LITE can handle paths with spaces... I think the problem was with the relative path to file.php.

Try this:

Code: Select all
* * * * * C:\Program Files\xampp\php\php.exe C:\php\file.php


or

Code: Select all
* * * * * "C:\Program Files\xampp\php\php.exe" C:\php\file.php
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest

cron