Share » Forums » General » Cronjob error

Cronjob error

Cronjob error

Monday 30 July 2007 11:29:23 pm - 5 replies

Modified on Monday 30 July 2007 11:30:32 pm by Philip K.

Author Message

Ɓukasz Serwatka

Tuesday 31 July 2007 11:57:49 pm

Hi,

You can execute your cronjob script with debug output as:

$ php runcronjobs.php -dall

Make sure that your PHP version is correct and is CLI enabled.

$ php -v

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Philip K.

Monday 06 August 2007 6:33:21 am

Hi.

Thanks for your reply.

Is tested it with

# php runcronjobs.php -dall

And got this result by email:

Fatal error: eZ publish did not finish its request
The execution of eZ publish was abruptly ended, the debug output is present below. No timing points defined Group ini_load: 
Load cache: 0.0540 sec (40.1041%), 0.0270 avg sec (2)
FindInputFiles: 0.0055 sec (4.0696%), 0.0027 avg sec (2)
Parse: 0.0359 sec (26.6808%), 0.0359 avg sec (1)
Save Cache: 0.0029 sec (2.1455%), 0.0029 avg sec (1)

Total script time: 0.1346 sec

What does it say? I don't understand...

I also tried it with

# php -v runcronjobs.php -dall

and got:

PHP 4.4.0 (cli) (built: Jun 20 2006 10:29:29)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

But the object is still there and isn't unpublished...

Thanks for your help,
Philip

Linux is like a wigwam; no windows, now gates, and apache inside!

kracker (the)

The Doctor

Monday 06 August 2007 7:07:57 am

If I was troubleshooting this problem I would consider acting on the following

1) Install and enable Xdebug, <i>http://xdebug.org/install.php</i>
2) Share your list of enabled cronjobs (from, 'settings/cronjob.ini', '[CronjobSettings]' and 'Scripts[]') here in the forum thread
3) Try again (with xdebug enabled) and share the xdebug output here in the forum thread.

It is my idea that xdebug will show you a wealth of greater debug / error output which will help point out the specific problem you are encountering.

<i>http://ezpedia.org/wiki/en/ez/debugging
http://ezpedia.org/wiki/en/ez/xdebug</i>

<i>//kracker

Bizarre - Hannicap Circus - Doctor Doctor ....</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Xavier Dutoit

Monday 06 August 2007 9:55:24 am

Hi,

That's likely that some php extensions are only installed for the php modules and not the php cli one, or that the path is incorrect and from the shell you use php cli and from the cronjob a php-cgi (or php5 or...) .

run php-v from the cron and see if you have the same than from the shell.

do the same with php -i (see if you have the mysql module installed)

X+

http://www.sydesy.com

Bruce Morrison

Monday 06 August 2007 6:06:31 pm

Hi Philip

In addition to the other advice in the thread you should use full paths in these types of jobs. It not a good idea to reply on the environment to work these things out.

When you are logged in find out the full path of the php cli using whereis and modify your script to use this. e.g.

# whereis php
php: /usr/bin/php /etc/php.ini /etc/php.d /usr/share/man/man1/php.1.gz

So where you'd replace "php runcronjobs.php" with "/usr/bin/php runcronjobs.php"

Once you have modified the script check that you can run the script when logged in (as opposed to running the script directly via the command line)

Is the script being run by the same user when you are logged in as it is when you are running it via cron. Do they have the same permissions, are they able to read(and write to) all same the files.

You might want specifically define the siteaccess you want the job to run under. e.g.

/usr/bin/php runcronjobs.php -s plain_admin

(This doesn't appear to be an issue as you can run it on the command line - but good to be specific)

HTH

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu