Forum Moderators: coopster

Message Too Old, No Replies

Cron Questions

         

ahmedtheking

5:04 pm on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a few questions about cron files:

Can I include other files? Eg

<?php
require(config.php);
....

That's pretty much it! I'm running a cron job from DirectAdmin and I keep getting an error email with:

/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 1:?php: No such file or directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 2: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 3: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 4: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 38: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: syntax error near unexpected token `('
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: `$udq = mysql_query("SELECT * FROM $CustomersTable",$Link) or die(mysql_error());'

And if I run the file in my web browser, it works fine! Confused :S

Timotheos

10:48 pm on Nov 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can I include other files? Eg

Yep

That's pretty much it! I'm running a cron job from DirectAdmin and I keep getting an error email

Strange. I don't know this admin panel. Have you tried asking in the DirectAdmin forums [directadmin.com]?

Tim

dreamcatcher

8:33 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Direct Admin is a great Control Panel, very user friendly. I have a similar problem with C Panel in that I get an e-mail with gibberish in. However, the cron still runs ok.

Might be a Direct Admin bug.

dc

ahmedtheking

9:03 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's really strange. I tested the file on my machine (Mac with XAMPP) and it worked fine! But i'll try my luck with the DA forums! Thanks!

wsmeyer

6:43 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



I had a very similar problem. My host explained that when windows runs the cron script it isn't run through the web server so it doesn't understand the php. Adding this chunk to the beginning of the actual cron command:

php -q /home/...

and this to the php script page:

#!/usr/local/bin/php -q

took care of the problem. Not sure if this is the same for all servers but it's worth a shot.

William.

ahmedtheking

11:25 am on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm nice idea, although my server is on linux, i'll try it out and contact my hosts about it (don't know why i didn't think of contacting them!)