Forums / Setup & design / Setting include_path correctly for EZ Newsletter

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 ?