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.

eZ debug

Timing: Jan 18 2025 19:20:58
Script start
Timing: Jan 18 2025 19:20:58
Module start 'layout'
Timing: Jan 18 2025 19:20:58
Module start 'content'
Timing: Jan 18 2025 19:20:58
Module end 'content'
Timing: Jan 18 2025 19:20:58
Script end

Main resources:

Total runtime0.6776 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.1641152.6563
Module start 'layout' 0.00750.0034 740.820339.5078
Module start 'content' 0.01090.6651 780.3281591.4844
Module end 'content' 0.67600.0015 1,371.812516.1094
Script end 0.6775  1,387.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5698160.0002
Check MTime0.00140.2046160.0001
Mysql Total
Database connection0.00080.121910.0008
Mysqli_queries0.599188.4225660.0091
Looping result0.00070.0964640.0000
Template Total0.640794.620.3204
Template load0.00180.272720.0009
Template processing0.638994.283920.3194
Template load and register function0.00020.029910.0002
states
state_id_array0.00090.127110.0009
state_identifier_array0.00240.353320.0012
Override
Cache load0.00170.2501610.0000
Sytem overhead
Fetch class attribute can translate value0.00070.096720.0003
Fetch class attribute name0.00200.291870.0003
XML
Image XML parsing0.00060.094320.0003
class_abstraction
Instantiating content class attribute0.00000.003080.0000
General
dbfile0.00080.1251180.0000
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
18content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 42
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs