Hi all:

I set up a Cron Job on my host which runs /cron.php every hour. I now get these e-mails:

From: Cron Daemon [mailto:jewishce@web4.hivelocity.net]
Sent: Monday, November 07, 2005 10:00 AM
To: support@jewishcenter.org
Subject: Cron /usr/local/bin/php
/hsphere/local/home/jewishce/jewishcenter.org/cron.php

Warning: main(sites/default/settings.php): failed to open stream: No such
file or directory in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
642

Warning: main(): Failed opening 'sites/default/settings.php' for inclusion
(include_path='.:/usr/local/lib/php') in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
642

Warning: main(includes/database.inc): failed to open stream: No such file or
directory in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
643

Warning: main(): Failed opening 'includes/database.inc' for inclusion
(include_path='.:/usr/local/lib/php') in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
643

Warning: main(includes/session.inc): failed to open stream: No such file or
directory in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
644

Warning: main(): Failed opening 'includes/session.inc' for inclusion
(include_path='.:/usr/local/lib/php') in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
644

Warning: main(includes/module.inc): failed to open stream: No such file or
directory in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
645

Warning: main(): Failed opening 'includes/module.inc' for inclusion
(include_path='.:/usr/local/lib/php') in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
645

Fatal error: Call to undefined function: db_fetch_object() in
/hsphere/local/home/jewishce/jewishcenter.org/includes/bootstrap.inc on line
199

My host says:

Try setting your paths to be absolute. So for
includes/session.inc
for example make it
/hsphere/local/home/jewishce/jewishcenter.org/includes/session.inc

It seems odd that I would have to change the core code. I'm sure there's another solution.

(See also this other post where I had to change user.module for e-mail to work: http://drupal.org/node/34362)

Thanks in advance for any guidance.

--Dave

Comments

gerd riesselmann’s picture

From the handbook:

Note that it is essential to access cron.php using a browser on the web site's domain; do not run it using command line PHP directly

http://drupal.org/node/23714

You need to call cron.php using wget, lynx or any other browser.

------------------
Gerd Riesselmann
www.gerd-riesselmann.net

DaveNotik’s picture

Thanks Gerd.

Can I change the command itself?

The Cron Job configured on my host executes this command:

/usr/local/bin/php /hsphere/local/home/jewishce/jewishcenter.org/cron.php

Can I change that so it runs wget or lynx? I didn't fully understand the related handbook instructions.

--Dave

xqus’s picture

It should be something like this:

fetch http://jewishcenter.org/cron.php

---
Audun Larsen

DaveNotik’s picture

Responded with this error via e-mail:

fetch: www.jewishcenter.org/cron.php: size of remote file is not known

0 bytes transferred in 0.0 seconds (0.00 Bps)

Should I use a wget command or...?

Thanks again for all help. It's much appreciated.

mikevk’s picture

Try something like this:
/usr/local/bin/lynx -source http://www.jewishcenter.org/cron.php > /dev/null 2>&1

You may need to change the path to lynx, depending on your host.

xqus’s picture

This is what i use:
fetch -o /dev/null -q http://domain.tld/cron.php

---
Audun Larsen
lkonsult.no

gerd riesselmann’s picture

...because your provider disabled wget, lynx, curl and related (like mine did), try http://www.webcron.org/

Before that I used wget -q http://example.org/cron.php

------------------
Gerd Riesselmann
www.gerd-riesselmann.net

Magika’s picture

I had some problems with this and took the easy route out and used the poormanscron module. This makes life very simple but is probably not the long term solution.