cronjobs doesn"t read siteaceess / connect to db

Author Message

noamse s.

Sunday 23 April 2006 4:59:16 am

hi all,

i have been trying to use the runcronjobs.php script, but unfortunately it does work and does not connect to the database. ("Error initializing script: database error: No database handler was found for ' '.)

i have tried to manually plant the siteaccess and even the DB username/password in \kernel\classes\ezscript.php and \lib\ezdb\classes\ezdb.php files, but no luck.

i have tried the folloing command lines (through crontab) but no luck
/usr/local/bin/php -d include_path=.:/home/noamse/public_html/site /home/noamse/public_html/site/runcronjobs.php

/usr/local/bin/php -d include_path=.:/home/noamse/public_html/site /home/noamse/public_html/site/runcronjobs.php -s backoffice

and even
/usr/local/bin/php -d include_path=.:/home/noamse/public_html/site /home/noamse/public_html/site/runcronjobs.php -sbackoffice

and this is the output i keep getting:

Siteaccess backoffice does not exist, using default siteaccess

Warning: in_array(): Wrong datatype for second argument in
/home/noamse/public_html/site/kernel/classes/ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in
/home/noamse/public_html/site/kernel/classes/ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in
/home/noamse/public_html/site/kernel/classes/ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in
/home/noamse/public_html/site/kernel/classes/ezscript.php on line 1075
Error initializing script: database error: No database handler was
found for ''.

help would be highly appreciated

thanks,
noam

noamse s.

Sunday 23 April 2006 5:55:55 am

now the siteaccess is found (using the full path for the siteaccess itself)

/usr/local/bin/php -d include_path=.:/home/noamse/public_html/site /home/noamse/public_html/site/runcronjobs.php --ssettings/siteaccess/backoffice

but still, unable to connect to the database

"Error initializing script: database error: No database handler was found for ' '. "

Łukasz Serwatka

Sunday 23 April 2006 8:40:05 am

Make sure that you have correct version of PHP installed in your system, run

php -v

You need PHP 4.4.x (cli) or higher from 4 line for eZ publish 3.7, or 4.3.x for 3.6 and lower.

cron job script should be run from your eZ publish root directory:

$ cd ez_publish_path
$ php runcronjobs.php

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

noamse s.

Sunday 23 April 2006 11:45:09 am

thanks Lukasz,

i have ez 3.7.5 running on PHP 4.4

the problem is that i don't have shell access, and therefore have to use crontab to run scripts, and can not run them from the ez-root-dir.

i have no idea why the db connection is not working even when i manually hard-code the username/password in the ezdb.php script.

thanks,
noam

Łukasz Serwatka

Sunday 23 April 2006 10:56:21 pm

You can type sequence of commands in crontab, first changedir to ezpublish_root, then execute the script e.g:

# This must be set to the directory where eZ publish is installed.
EZPUBLISHROOT=/home/noamse/public_html/site
 
# Location of the PHP Command Line Interface binary.
PHP=/usr/local/bin/php
 
# Executes the runcronjobs.php script every 15th minute.
0,15,30,45 * * * * cd $EZPUBLISHROOT; $PHP -C runcronjobs.php -q 2>&1

or just

0,15,30,45 * * * * cd /home/noamse/public_html/site; /usr/local/bin/php -C runcronjobs.php -q 2>&1

Look here for more info.
http://ez.no/products/ez_publish/documentation/installation/the_cronjob_script

Look also here for other alternative:
http://ez.no/products/ez_publish/documentation/configuration/configuration/cron_jobs

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

noamse s.

Monday 24 April 2006 1:24:05 am

dear Lukasz,

thank you so much!

your suggestion seems to be working. i have tried to use it on the new newsletter extention, so for others interested, i am posting here the crontab line i have used:

0,15,30,45 * * * * cd /home/noamse/public_html/site; /usr/local/bin/php -C runcronjobs.php -s mysiteaccess send_newsletter

noam

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.