Setting include_path correctly for EZ Newsletter

Author Message

David Jones

Thursday 16 November 2006 1:14:26 am

I have an installation of EZP using the 3.8 windows installer on win 2k3 server.

I am having trouble sending my newsletters and the suggestion is that it is my ezp setup that is the problem.

When I try and run the send cron job I get a long page of errors from the console

I'm sure I'm doing something stupid. Please help,

Below are just the first few.

Warning: main(lib/ezutils/classes/ezini.php): failed to open stream: No such file or directory in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezextension.php on line 39

Warning: main(): Failed opening 'lib/ezutils/classes/ezini.php' for inclusion (include_path='.;c:\php4\pear') in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezextension.php on line 39

Warning: main(lib/ezutils/classes/ezdebug.php): failed to open stream: No such file or directory in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezmodule.php on line 37

Warning: main(): Failed opening 'lib/ezutils/classes/ezdebug.php' for inclusion
(include_path='.;c:\php4\pear') in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezmodule.php on line 37

Warning: main(lib/ezutils/classes/ezini.php): failed to open stream: No such file or directory in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezcli.php on line 52

This was the suggestion from the contrib forum.

It seems that the include_path can/is not set correctly on your system. Please add your OS Version, Webserver + Version, PHP + Version information to the questions on the forum.
Possible reasons also could be that you denied in the php.ini the function ini_set.

How do I fix this?

Thanks for your time

David Jones

Thursday 16 November 2006 1:30:39 am

I thought I would include the command I'm using to run the job incase that is the problem.

E:\ApacheSites\eZpublish\php>php E:\ApacheSites\eZpublish\ezpublish\runcronjobs.
php E:\ApacheSites\eZpublish\ezpublish\extension\ezxnewsletter\cronjobs\send_newsletter.php

I've also modified my php.ini file to read

; Windows: "\path1;\path2"
include_path = ".;c:\php\includes;E:\ApacheSites\eZpublish\ezpublish"

Made no differnece

David Jones

Thursday 16 November 2006 2:00:21 am

Thanks to Tobias on the contrib forums I'm moving forward a pace.

My first error has now gone and been replaced with the following.

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075
Error initializing script: database error: No database handler was found for ''.

Your help is greatly appreciated.

Tobias Struckmeier

Thursday 16 November 2006 2:25:16 am

do you run it with:

php c:\path_to_your_ezp_root_dir\runcronjobs.php send_newsletter

?

David Jones

Thursday 16 November 2006 4:05:44 am

it's run with the following

E:\ApacheSites\eZpublish\php>php E:\ApacheSites\eZpublish\ezpublish\runcronjobs.
php E:\ApacheSites\eZpublish\ezpublish\extension\ezxnewsletter\cronjobs\send_new
sletter

I've also tried with send_newsletter.php

Thanks

Tobias Struckmeier

Thursday 16 November 2006 5:29:48 am

No i meant

replace

E:\ApacheSites\eZpublish\php>php E:\ApacheSites\eZpublish\ezpublish\runcronjobs.php E:\ApacheSites\eZpublish\ezpublish\extension\ezxnewsletter\cronjobs\send_newsletter

with

E:\ApacheSites\eZpublish\php>php E:\ApacheSites\eZpublish\ezpublish\runcronjobs.php send_newsletter

so without that path infront of send_newsletter.

David Jones

Thursday 16 November 2006 6:05:15 am

Hi,

I have now tried that and have the same error:

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075

Warning: in_array(): Wrong datatype for second argument in E:\ApacheSites\eZpubl
ish\ezpublish\kernel\classes\ezscript.php on line 1075
Error initializing script: database error: No database handler was found for ''.

Thanks for your help

Tobias Struckmeier

Thursday 16 November 2006 7:16:24 am

What is your exact php & ezp version?

ezp 3.8.x ?
php 4.x.x ?

David Jones

Thursday 16 November 2006 7:29:10 am

ezp 3.8.6
php 4.4

David Jones

Friday 17 November 2006 8:46:15 am

Can anybody offer a clue as to what is wrong with my setup?

Thanks in advance

David Jones

Friday 17 November 2006 9:07:02 am

I've managed to get a little further.

I have a new error message.

What does this mean?

E:\ApacheSites\eZpublish\ezpublish>E:\ApacheSites\eZpublish\php\php runcronjobs.
php -s mysiteaccess sendnewsletter
Using siteaccess mysiteaccess for cronjob
Running cronjob part 'sendnewsletter'
Notice: No scripts found for execution.

Claudia Kosny

Friday 17 November 2006 12:40:14 pm

Hi David

This is just a typo in your arguments, it should be send_newsletter (notice the underscore).

From the error message you posted previously I am taking a wild guess:
Have a look the site.ini of the site access you use for running the script. There check the block [DebugSettings] and there the settings for AlwaysLog[]=... . Make sure you have the brackets there - the error message indicates that you have only a string there, not a list.
If necessary also check the site.ini in the override folder.

Empty the cache and try again.

Good luck

Claudia

David Jones

Tuesday 21 November 2006 7:46:14 am

Thanks Claudia, Fixed the Typo but still the same error.

My site access site.ini has no entry for debug settings.

But the main one has this

AlwaysLog[]
AlwaysLog[]=error

What should it be?

Thanks

Claudia Kosny

Tuesday 21 November 2006 1:49:44 pm

Hi David

This looks exactly the way it should, so this does not cause the problem. Also I have just seen that I missed the last error message, the one about the missing database handler.

Both errors, the one with the in_array and the missing database handler, indicate that the site.ini of the site access your specify is not read properly.
The in_array error happens because ez tries to read the AlwaysLog variable and expects it to be an array. From what you posted, it is an array, so it seems like the cronjobs reads from another site.ini.
The error about the missing database handler happens because ez tries to read the variable DatabaseImplementation in the block [DatabaseSettings] in the site.ini. The content of this variable should be ezmysql or ezpostgresql, but it is empty in the site.ini that your cronjob tries to read.

So try to use a different siteaccess or check the site.ini of the siteaccess you specify. If everything should be alright with the settings of your siteaccess, I don't know what else to check for...

Good luck

Claudia

David Jones

Thursday 23 November 2006 1:55:31 am

Thanks Claudia,

I tried it with the admin site access and it worked. Well, it ran anyway.

Now just to work out how I create newsletter.

*smile*

Aurélien DESNEUX

Friday 02 February 2007 2:07:21 am

hi,

I have the same eror :

Warning: main(lib/ezutils/classes/ezini.php): failed to open stream: No such file or directory in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezextension.php on line 39

Warning: main(): Failed opening 'lib/ezutils/classes/ezini.php' for inclusion (include_path='.;c:\php4\pear') in E:\ApacheSites\eZpublish\ezpublish\lib\ezutils\classes\ezextension.php on line 39

How do I fix this please ?

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 16:05:23
Script start
Timing: Jan 18 2025 16:05:23
Module start 'layout'
Timing: Jan 18 2025 16:05:23
Module start 'content'
Timing: Jan 18 2025 16:05:24
Module end 'content'
Timing: Jan 18 2025 16:05:24
Script end

Main resources:

Total runtime0.8006 sec
Peak memory usage4,096.0000 KB
Database Queries100

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1797152.6406
Module start 'layout' 0.00560.0041 741.820339.4766
Module start 'content' 0.00970.7896 781.2969737.9844
Module end 'content' 0.79930.0013 1,519.281328.1250
Script end 0.8006  1,547.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4301160.0002
Check MTime0.00160.2001160.0001
Mysql Total
Database connection0.00080.097210.0008
Mysqli_queries0.708688.50881000.0071
Looping result0.00080.1024980.0000
Template Total0.768896.020.3844
Template load0.00210.260020.0010
Template processing0.766795.763120.3834
Template load and register function0.00010.018010.0001
states
state_id_array0.00080.103910.0008
state_identifier_array0.00080.097920.0004
Override
Cache load0.00200.2450980.0000
Sytem overhead
Fetch class attribute can translate value0.00060.072840.0001
Fetch class attribute name0.00120.1448170.0001
XML
Image XML parsing0.00100.123740.0002
class_abstraction
Instantiating content class attribute0.00000.0038190.0000
General
dbfile0.00090.1110160.0001
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
16content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
30content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
12content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 67
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs