Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piwik on Tomcat #701

Closed
anonymous-matomo-user opened this issue May 12, 2009 · 4 comments
Closed

Piwik on Tomcat #701

anonymous-matomo-user opened this issue May 12, 2009 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@anonymous-matomo-user
Copy link

I am experiencing problems when trying to configure Tomcat (6.0.16) to have Piwik running on it? I managed to get it running on Apache (2.2) without any problems, but need to get it on Tomcat. I'm using PHP 5 and can manage to open test.php within Tomcat but as soon as I try to access piwik.php this is the source of the resulting page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

This is what's returned when I open index.php:

Undefined index: SCRIPT_NAME
in 'C:\apache-tomcat-6.0.16\webapps\piwik\core\Url.php' at the line 89
#0 Piwik_ErrorHandler(8, Undefined index: SCRIPT_NAME, C:\apache-tomcat-6.0.16\webapps\piwik\core\Url.php, 89, Array ([=> )) called at C:\apache-tomcat-6.0.16\webapps\piwik\core\Url.php:89
#1 Piwik_Url::getCurrentScriptName() called at [C:\apache-tomcat-6.0.16\webapps\piwik\core\Url.php:50]
#2 Piwik_Url::getCurrentUrlWithoutFileName() called at [C:\apache-tomcat-6.0.16\webapps\piwik\core\View.php:48]
#3 Piwik_View->__construct(Installation/templates/structure.tpl) called at [C:\apache-tomcat-6.0.16\webapps\piwik\plugins\Installation\View.php:22]
#4 Piwik_Install_View->__construct(Installation/templates/welcome.tpl, Array ([=> welcome,1 => systemCheck,[=> databaseSetup,3 => tablesCreation,[=> generalSetup,5 => firstWebsiteSetup,[=> displayJavascriptCode,7 => finished), welcome) called at [C:\apache-tomcat-6.0.16\webapps\piwik\plugins\Installation\Controller.php:63]
#5 Piwik_Installation_Controller->welcome() called at [C:\apache-tomcat-6.0.16\webapps\piwik\plugins\Installation\Installation.php:61]
#6 Piwik_Installation->startInstallation(Piwik_Event_Notification Object ([=> FrontController.NoConfigurationFile,_notificationObject => Exception Object ([=> The configuration file C:\apache-tomcat-6.0.16\webapps\piwik/config/config.ini.php has not been found., => ,[=> 0, => C:\apache-tomcat-6.0.16\webapps\piwik\core\Config.php,[=> 108, => Array ([=> Array (file => C:\apache-tomcat-6.0.16\webapps\piwik\core\Piwik.php,[=> 1260,function => init,[=> Piwik_Config,type => ->,[=> Array ()),1 => Array ([=> C:\apache-tomcat-6.0.16\webapps\piwik\core\FrontController.php,line => 216,[=> createConfigObject,class => Piwik,[=> ::,args => Array ()),[=> Array (file => C:\apache-tomcat-6.0.16\webapps\piwik\index.php,[=> 48,function => init,[=> Piwik_FrontController,type => ->,[=> Array ()))),_notificationInfo => Array (),[=> 0,_notificationCount => 0))
#7 call_user_func_array(Array ([=> Piwik_Installation Object ( => Piwik_Installation_Controller),[=> startInstallation), Array (0 => Piwik_Event_Notification Object ([=> FrontController.NoConfigurationFile,_notificationObject => Exception Object ([=> The configuration file C:\apache-tomcat-6.0.16\webapps\piwik/config/config.ini.php has not been found., => ,[=> 0, => C:\apache-tomcat-6.0.16\webapps\piwik\core\Config.php,[=> 108, => Array ([=> Array (file => C:\apache-tomcat-6.0.16\webapps\piwik\core\Piwik.php,[=> 1260,function => init,[=> Piwik_Config,type => ->,[=> Array ()),1 => Array ([=> C:\apache-tomcat-6.0.16\webapps\piwik\core\FrontController.php,line => 216,[=> createConfigObject,class => Piwik,[=> ::,args => Array ()),[=> Array (file => C:\apache-tomcat-6.0.16\webapps\piwik\index.php,[=> 48,function => init,[=> Piwik_FrontController,type => ->,[=> Array ()))),_notificationInfo => Array (),[=> 0,_notificationCount => 0))) called at [C:\apache-tomcat-6.0.16\webapps\piwik\libs\Event\Dispatcher.php:214]
#8 Event_Dispatcher->addObserver(Array ([=> Piwik_Installation Object ( => Piwik_Installation_Controller),[=> startInstallation), FrontController.NoConfigurationFile) called at C:\apache-tomcat-6.0.16\webapps\piwik\core\PluginsManager.php:360
#9 Piwik_PluginsManager->addPluginObservers(Piwik_Installation Object ([=> Piwik_Installation_Controller)) called at C:\apache-tomcat-6.0.16\webapps\piwik\core\PluginsManager.php:246
#10 Piwik_PluginsManager->loadPlugins() called at [C:\apache-tomcat-6.0.16\webapps\piwik\core\PluginsManager.php:161]
#11 Piwik_PluginsManager->setPluginsToLoad(Array ([=> CorePluginsAdmin,1 => CoreAdminHome,[=> CoreHome,3 => API,[=> Widgetize,5 => LanguagesManager,[=> Actions,7 => Dashboard,[=> Referers,9 => UserSettings,[=> UserCountry,11 => VisitsSummary,[=> VisitFrequency,13 => VisitTime,[=> VisitorInterest,15 => ExampleAPI,[=> ExamplePlugin,17 => ExampleRssWidget,[=> ExampleFeedburner,19 => ExampleRssWidget,[=> Provider,21 => Feedback,[=> Login,23 => UsersManager,[=> SitesManager,25 => Installation)) called at [C:\apache-tomcat-6.0.16\webapps\piwik\core\FrontController.php:224]
#12 Piwik_FrontController->init() called at [C:\apache-tomcat-6.0.16\webapps\piwik\index.php:48]

It's shown in the browser screen, the Tomcat logs do not show any logging...

This information was posted by me on the forum with the topic name equal to the ticket summary. There, Matthieu instructed me to create a ticket.

Thanks for any help provided!

@robocoder
Copy link
Contributor

According to: http://wiki.apache.org/tomcat/UsingPhp php5.x isn't supported.

@anonymous-matomo-user
Copy link
Author

I managed to get PHP5 running on Tomcat 6. Can I still get support for getting Piwik running in this case?

Opening piwik.php now results in the following message:

Warning: parse_ini_file(config/config.ini.php) [function.parse-ini-file]: failed to open stream: No such file or directory in C:\apache-tomcat-6.0.16\webapps\forphp\core\Tracker\Config.php on line 54
Piwik is a free open source web analytics alternative to Google analytics.

Opening index.php shows the following:

Undefined index: SCRIPT_NAME
in 'C:\apache-tomcat-6.0.16\webapps\forphp\core\Url.php' at the line 89

#0 Piwik_ErrorHandler(8, Undefined index: SCRIPT_NAME, C:\apache-tomcat-6.0.16\webapps\forphp\core\Url.php, 89, Array ([=> )) called at C:\apache-tomcat-6.0.16\webapps\forphp\core\Url.php:89
#1 Piwik_Url::getCurrentScriptName() called at [C:\apache-tomcat-6.0.16\webapps\forphp\core\Url.php:50]
#2 Piwik_Url::getCurrentUrlWithoutFileName() called at [C:\apache-tomcat-6.0.16\webapps\forphp\core\View.php:48]
#3 Piwik_View->__construct(Installation/templates/structure.tpl) called at [C:\apache-tomcat-6.0.16\webapps\forphp\plugins\Installation\View.php:22]
#4 Piwik_Install_View->__construct(Installation/templates/welcome.tpl, Array ([=> welcome,1 => systemCheck,[=> databaseSetup,3 => tablesCreation,[=> generalSetup,5 => firstWebsiteSetup,[=> displayJavascriptCode,7 => finished), welcome) called at [C:\apache-tomcat-6.0.16\webapps\forphp\plugins\Installation\Controller.php:63]
#5 Piwik_Installation_Controller->welcome() called at [C:\apache-tomcat-6.0.16\webapps\forphp\plugins\Installation\Installation.php:61]
#6 Piwik_Installation->startInstallation(Piwik_Event_Notification Object ([=> FrontController.NoConfigurationFile,_notificationObject => Exception Object ([=> The configuration file C:\apache-tomcat-6.0.16\webapps\forphp/config/config.ini.php has not been found., => ,[=> 0, => C:\apache-tomcat-6.0.16\webapps\forphp\core\Config.php,[=> 108, => Array ([=> Array (file => C:\apache-tomcat-6.0.16\webapps\forphp\core\Piwik.php,[=> 1260,function => init,[=> Piwik_Config,type => ->,[=> Array ()),1 => Array ([=> C:\apache-tomcat-6.0.16\webapps\forphp\core\FrontController.php,line => 216,[=> createConfigObject,class => Piwik,[=> ::,args => Array ()),[=> Array (file => C:\apache-tomcat-6.0.16\webapps\forphp\index.php,[=> 48,function => init,[=> Piwik_FrontController,type => ->,[=> Array ()))),_notificationInfo => Array (),[=> 0,_notificationCount => 0))
#7 call_user_func_array(Array ([=> Piwik_Installation Object ( => Piwik_Installation_Controller),[=> startInstallation), Array (0 => Piwik_Event_Notification Object ([=> FrontController.NoConfigurationFile,_notificationObject => Exception Object ([=> The configuration file C:\apache-tomcat-6.0.16\webapps\forphp/config/config.ini.php has not been found., => ,[=> 0, => C:\apache-tomcat-6.0.16\webapps\forphp\core\Config.php,[=> 108, => Array ([=> Array (file => C:\apache-tomcat-6.0.16\webapps\forphp\core\Piwik.php,[=> 1260,function => init,[=> Piwik_Config,type => ->,[=> Array ()),1 => Array ([=> C:\apache-tomcat-6.0.16\webapps\forphp\core\FrontController.php,line => 216,[=> createConfigObject,class => Piwik,[=> ::,args => Array ()),[=> Array (file => C:\apache-tomcat-6.0.16\webapps\forphp\index.php,[=> 48,function => init,[=> Piwik_FrontController,type => ->,[=> Array ()))),_notificationInfo => Array (),[=> 0,_notificationCount => 0))) called at [C:\apache-tomcat-6.0.16\webapps\forphp\libs\Event\Dispatcher.php:214]
#8 Event_Dispatcher->addObserver(Array ([=> Piwik_Installation Object ( => Piwik_Installation_Controller),[=> startInstallation), FrontController.NoConfigurationFile) called at C:\apache-tomcat-6.0.16\webapps\forphp\core\PluginsManager.php:360
#9 Piwik_PluginsManager->addPluginObservers(Piwik_Installation Object ([=> Piwik_Installation_Controller)) called at C:\apache-tomcat-6.0.16\webapps\forphp\core\PluginsManager.php:246
#10 Piwik_PluginsManager->loadPlugins() called at [C:\apache-tomcat-6.0.16\webapps\forphp\core\PluginsManager.php:161]
#11 Piwik_PluginsManager->setPluginsToLoad(Array ([=> CorePluginsAdmin,1 => CoreAdminHome,[=> CoreHome,3 => API,[=> Widgetize,5 => LanguagesManager,[=> Actions,7 => Dashboard,[=> Referers,9 => UserSettings,[=> UserCountry,11 => VisitsSummary,[=> VisitFrequency,13 => VisitTime,[=> VisitorInterest,15 => ExampleAPI,[=> ExamplePlugin,17 => ExampleRssWidget,[=> ExampleFeedburner,19 => ExampleRssWidget,[=> Provider,21 => Feedback,[=> Login,23 => UsersManager,[=> SitesManager,25 => Installation)) called at [C:\apache-tomcat-6.0.16\webapps\forphp\core\FrontController.php:224]
#12 Piwik_FrontController->init() called at [C:\apache-tomcat-6.0.16\webapps\forphp\index.php:48]

@robocoder
Copy link
Contributor

Unfortunately, Tomcat doesn't appear to set the SCRIPT_NAME variable; Apache and IIS do, and pass this to PHP. I'll see if there's a workaround, but the problem here lies in Tomcat.

@robocoder
Copy link
Contributor

Instead of invoking php-cgi directly, I suggest you have Tomcat run a bash script (wrapper) that sets the missing CGI environment variables and then running the php-cgi executable.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants