HELP PLEASE - Weblogic problems

Dears,

I tired search for Weblogic threads and found nothing. Please help me configuring Piwik with weblogic 10. Piwik Servlet is crashing weblogic when I try to invoke some page.

I had success with Apache and Piwik. But already Tomcat 6 was refusing to cooperate.

Are there any instructions, and forum know-how on this subject. I tried many things over long time and no success with WL.

PLEASE HELP…

Does a simple phpinfo.php script work?

<?php phpinfo();

[quote=vipsoft @ Jul 21 2010, 04:15 PM]Does a simple phpinfo.php script work?

<?php phpinfo();

[/quote]

I have created some defaultPHPWebApp with all necessary CGIServlet settings in web.xml and weblogic.xml descriptor. so now when I type php.info I get text like at end of this post. Also I added piwik extracted zip to servlet’s php script path. When I try to invoke piwik.php I get following:

Warning: parse_ini_file(M:\piwik/config/config.ini.php): failed to open stream: No such file or directory in M:\piwik\libs\upgradephp\upgrade.php on line 463
Piwik is a free open source web analytics alternative to Google analytics.

However, the php script exists, but do I need to put every folder that contains php file into into servlet cgidir ?? What is the easyest and fastest way to get it working. I haven’t even started with db stuff, I guess there will be more job to do…

Anyway, will including piwik and all folders be enough ?

many thanks.

===========================================================
Web.xml for the setting of PHP and piwik into the PHP script path.

<servlet>
	<servlet-name>PHPCGIServlet</servlet-name>
	<servlet-class>weblogic.servlet.CGIServlet</servlet-class>
	<init-param>
		<param-name>cgiDir</param-name>
		<param-value>M:/php_scripts;M:/piwik</param-value>
	</init-param>
	<init-param>
		<param-name>*.php</param-name>
		<param-value>php.exe</param-value>
	</init-param>
	<init-param>
		<param-name>useByteStream</param-name>
		<param-value>true</param-value>
	</init-param>
	<init-param>
		<param-name>debug</param-name>
		<param-value>true</param-value>
	</init-param>
</servlet>

<servlet-mapping>
	<servlet-name>PHPCGIServlet</servlet-name>
	<url-pattern>*.php</url-pattern>
</servlet-mapping>

<welcome-file-list>
	<welcome-file>piwik.php</welcome-file>
</welcome-file-list>

===========================================================
PHP INFO - some of settings that might be important

Core

PHP Version => 5.3.1

Directive => Local Value => Master Value
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &

Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports => tcp, udp, ssl, sslv3, sslv2, tls
Registered Stream Filters => convert.iconv., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, zlib., bzip2.

CharConv => No
Protocols => tftp, ftp, telnet, dict, ldap, http, file, https, ftps, scp, sftp
Host => i386-pc-win32
SSL Version => OpenSSL/0.9.8l
ZLib Version => 1.2.3
libSSH Version => libssh2/1.1

mysql

MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
Persistent cache => enabled

Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.cache_size => 2000 => 2000
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off

mysqlnd

mysqlnd => enabled
Version => mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No

1 Like

Bear with me, as I don’t actually use weblogic – however, I do see similarities with my Jetty and PHP CGI servlet configuration.

Do you have cgi.force_redirect = 0 in php.ini?

You should make index.php a welcome file (not piwik.php).

[quote=vipsoft @ Jul 22 2010, 02:49 PM]Bear with me, as I don’t actually use weblogic – however, I do see similarities with my Jetty and PHP CGI servlet configuration.

Do you have cgi.force_redirect = 0 in php.ini?

You should make index.php a welcome file (not piwik.php).[/quote]

Hey, thanks for assistance. We are suffering with this more than a year. We gave up many times, but issues comes back on my task list, so please feel free to propose me things to try as I am running out of inspiration.

I would start here:

Weblogic finds only one php script that is directly visible thru the setting : M:/php_scripts;M:/piwik

Being a java developer, I would put every single php script into the path of this servlet, but I think that would be wrong way to go. Can’t I give some global path to this servlet to find them all, including property, config files that are inside various directories…

Yes I have that setting that you mentioned.

This reminds me on a problem that my colleague has asked before: dev.piwik.org / trac / ticket/701

That shouldn’t be a major difference with Jetty… I specify a context (which is associated with a directory), and everything in that directory that matches (*.php) can be executed by php-cgi.

Do you have open.base_dir restrictions?

Instead of running php-cgi directly, I suggest you use a bash script as a wrapper to set any missing environment variables. (Look at the Environment section at the end of the phpinfo() output.)

[quote=vipsoft @ Jul 22 2010, 07:38 PM]That shouldn’t be a major difference with Jetty… I specify a context (which is associated with a directory), and everything in that directory that matches (*.php) can be executed by php-cgi.

Do you have open.base_dir restrictions?

Instead of running php-cgi directly, I suggest you use a bash script as a wrapper to set any missing environment variables. (Look at the Environment section at the end of the phpinfo() output.)[/quote]

No, I don’t have open.base_dir restrictions.

I am in windows environment, I don’ think that script would solve the problem. However, if you tell me what settings are needed (you aleady nkow my config dirs, m:\piwik, m:\bea… c:\program~1\php ) I can set them.

Thanks for your reply.

[quote=vipsoft @ Jul 22 2010, 02:49 PM]Bear with me, as I don’t actually use weblogic – however, I do see similarities with my Jetty and PHP CGI servlet configuration.

Do you have cgi.force_redirect = 0 in php.ini?

You should make index.php a welcome file (not piwik.php).[/quote]

Running index.php doesn’t do the job. It shows partial (broken) source of index.php.

Also , below answers aren’t helping. Any other clue?

PS:

Is there professional (payable) support from Piwik who can follow us step by step so I can outsource this task ??? If so, ping me to registration email. I am running in the circle…

Can you try:

<servlet-mapping>
<servlet-name>PHPCGIServlet</servlet-name>
<url-pattern>/piwik/*</url-pattern>
</servlet-mapping>

index.php should be the welcome file.

And browse to yoursite.com to start the installer.

note: the error with piwik.php is because you haven’t run the installer (config.ini.php doesn’t exist yet) and is thus, expected.

[quote=vipsoft @ Jul 23 2010, 01:37 PM]Can you try:

<servlet-mapping>
<servlet-name>PHPCGIServlet</servlet-name>
<url-pattern>/piwik/*</url-pattern>
</servlet-mapping>

index.php should be the welcome file.

And browse to yoursite.com to start the installer.

note: the error with piwik.php is because you haven’t run the installer (config.ini.php doesn’t exist yet) and is thus, expected.[/quote]

Hi, I have tried changing into what you proposed, but I always end up with same error message. I think that mapping of url gives same results regardless of how we map it as long as it can find piwik.php or whatever.php…

Error message is same as before:Warning: parse_ini_file(M:\piwik/config/config.ini.php): failed to open stream: No such file or directory in M:\piwik\libs\upgradephp\upgrade.php on line 463

Is there installer php script so I can try launching it manually ???

Thanks

==========
PS: I remember passing this point when I was using tomcat 6

piwik,php is for the tracker; it doesn’t start up the installer, hence the error message

what is the error message when you open /piwik/index.php?

[quote=vipsoft @ Jul 26 2010, 02:47 PM]piwik,php is for the tracker; it doesn’t start up the installer, hence the error message

what is the error message when you open /piwik/index.php?[/quote]

=== CUT HERE =============
value: 0

});

});

div.both { clear: both; } body { background-color: #F9F9F9; text-align: center; font-family:Arial,Georgia,"Times New Roman",Times,serif; font-size:17px; } #title{ font-size:50px; color:#284F92; } === THERE IS MORE =============

That looks like HTML. That means PHP did its job.

The problem appears to be:

<param-value>php.exe</param-value>

You appear to be loading the PHP-CLI binary which doesn’t send HTTP response headers, e.g., Content-type: text/html

[quote=vipsoft @ Jul 26 2010, 03:43 PM]That looks like HTML. That means PHP did its job.

The problem appears to be:

<param-value>php.exe</param-value>

You appear to be loading the PHP-CLI binary which doesn’t send HTTP response headers, e.g., Content-type: text/html[/quote]

Here is some example output from DOS. For me it looks that php is not interpreted everywhere as expected, look at “$(document).ready( function(){” . However when executing info.php all works fine.

This is pointing us in direction that some kind page generation is done correctly (html headers and body) and some (related to


div.both {
clear: both;
}
body {

M:\php_scripts>php info.php

PHP Test Script PETAR phpinfo() PHP Version => 5.3.1

System => Windows NT WS03-IBM-WEB 5.2 build 3790 (Windows Server 2003

index.php is a funnel for dynamic content requests, so it dispatches (loads) other .php files.

To assist in debugging your setup, edit your php.ini file and set these:

display_errors = On
log_errors = On
error_log = M:path/to/error.log

To verify that the correct php binary is used, create a file and browse to it:

<?php echo php_sapi_name();

The js errors may be because the static content isn’t loadable from the relative path of index.php.

Have you tried asking for help on the OTN forum?

[quote=vipsoft @ Jul 27 2010, 11:26 AM]The js errors may be because the static content isn’t loadable from the relative path of index.php.

Have you tried asking for help on the OTN forum?[/quote]

(OTN - I doubt, this is php, although someone might know, maybe some php forum would help me better).

I leave this for now, I can’t do it, I have been given different priority tasks now… … it’s pity that there aren’t tutorials on installing piwik on various app servers… ping me if something happens to be written. I will watch over this forum for a while.

Thanks a lot for your effort, your answers will probably help others as well, that’s one of added values of forums…

Piwik is a php app, you need a standard working php webserver. Some weird appservers won’t help much I assume.