Forums / Install & configuration / cronjobs doesn"t read siteaceess / connect to db

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

eZ debug

Timing: Jan 18 2025 16:22:14
Script start
Timing: Jan 18 2025 16:22:14
Module start 'content'
Timing: Jan 18 2025 16:22:16
Module end 'content'
Timing: Jan 18 2025 16:22:16
Script end

Main resources:

Total runtime1.5384 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.0938180.8047
Module start 'content' 0.00781.3138 769.8984596.5938
Module end 'content' 1.32160.2168 1,366.4922341.3750
Script end 1.5384  1,707.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2603210.0002
Check MTime0.00150.0950210.0001
Mysql Total
Database connection0.00130.081510.0013
Mysqli_queries1.456294.65292030.0072
Looping result0.00210.13842010.0000
Template Total1.506197.920.7530
Template load0.00210.137520.0011
Template processing1.503997.756420.7520
Template load and register function0.00010.008210.0001
states
state_id_array0.00130.082810.0013
state_identifier_array0.00130.086020.0007
Override
Cache load0.00190.1232610.0000
Sytem overhead
Fetch class attribute can translate value0.00130.083130.0004
Fetch class attribute name0.00120.075570.0002
XML
Image XML parsing0.00090.055730.0003
class_abstraction
Instantiating content class attribute0.00000.001080.0000
General
dbfile0.00280.1790290.0001
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 42
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs