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

Call to undefined function Piwik\fnmatch() #11237

Closed
bluesailor45 opened this issue Jan 19, 2017 · 14 comments · Fixed by #11369
Closed

Call to undefined function Piwik\fnmatch() #11237

bluesailor45 opened this issue Jan 19, 2017 · 14 comments · Fixed by #11369
Assignees
Milestone

Comments

@bluesailor45
Copy link

after upgrade to PIWIK 3.0.1 in Joomla, following error appears:
fatal error in PIWIK 3.0.1
Call to undefined function Piwik\fnmatch() in /share/MD0_DATA/.qpkg/Piwik/Piwik/core/FileIntegrity.php 312 using PHP 5.5.26

thereafter it is not possible to logon to PIWIK:

a fatal error occurred:
Please contact the system administrator, or login to Piwik to learn more.

If you are Super User, but cannot login because of this error, you can still troubleshoot further. Follow these steps:

  1. open the config/config.ini.php file and look for the salt value under [General].
  2. edit this current URL you are viewing and add the following text (replacing salt_value_from_config by the salt value from the config file):
    index.php?i_am_super_user=salt_value_from_config&....

However this 2) message is not useful for me.

@CheweyZ
Copy link
Contributor

CheweyZ commented Jan 19, 2017

What OS are you running this on?

@bluesailor45
Copy link
Author

Hi CheweyZ
I am running Linux-Firmware Version 4.2.1 in QNap TS-219P. In Joomla I am using Joomla 3.6.5 with PHP 5.5.26. I was upgrading PIWIK from Version 2.6.1 which was installed as a QNAP Application.
Thanks for your help.

@bluesailor45
Copy link
Author

No solution to that 😳???

@CheweyZ
Copy link
Contributor

CheweyZ commented Jan 28, 2017

So not 100% sure but it appears your system is none POSIX compliant which means that fnmatch is not able to run on your machine. To find out more see or confirm you machine-distro is a POSIX supported system as then php call only works on that.

Sorry for the little help.

@bluesailor45
Copy link
Author

Thank you very much for your hint. Any tip is welcome😉. I will check in this direction.

@tsteur
Copy link
Member

tsteur commented Feb 3, 2017

@bluesailor45 can you try to copy something like this in your "libs/upgradephp/upgrade.php"

if(!function_exists('fnmatch')) {

    function fnmatch($pattern, $string) {
        return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
    } // end

} // end if

I haven't tested it and only copied it from http://php.net/manual/en/function.fnmatch.php

We would need to define this method then in the future if it is not defined

@bluesailor45
Copy link
Author

@tsteur thank you very much for your help.
I added your suggested code add the end of upgrade.php and it did work!

Unfortunately I got an additional error while the upgrade is trying to upgrade the Mysql database:
Mysqli prepare error: Table 'Piwik_analytics.piwik_plugin_setting' doesn't exist

I checked the Piwik_analytics.piwik database and the mentioned table really does not exist. Please provide me with the correct create table command.
Thank you very much.

@bluesailor45
Copy link
Author

bluesailor45 commented Feb 4, 2017 via email

@RMastop
Copy link
Contributor

RMastop commented Feb 4, 2017

Please use this to create the table

CREATE TABLE `piwik_plugin_setting` (
  `plugin_name` varchar(60) NOT NULL,
  `setting_name` varchar(255) NOT NULL,
  `setting_value` longtext NOT NULL,
  `user_login` varchar(100) NOT NULL DEFAULT '',
  KEY `index_plugin_name_user_login` (`plugin_name`,`user_login`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

@bluesailor45
Copy link
Author

bluesailor45 commented Feb 4, 2017 via email

@RMastop
Copy link
Contributor

RMastop commented Feb 4, 2017

Hi,

The requested info:
CREATE TABLE piwik_site_setting(idsiteint(10) unsigned NOT NULL,plugin_namevarchar(60) NOT NULL,setting_namevarchar(255) NOT NULL,setting_valuelongtext NOT NULL, KEYidsite (idsite,plugin_name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

@bluesailor45
Copy link
Author

bluesailor45 commented Feb 4, 2017 via email

@RMastop
Copy link
Contributor

RMastop commented Feb 4, 2017

Hi @bluesailor45,

It might actually be correct to remove those files and directories. Do you have a way to remove the directories and files from the device? Piwik 3.0.1 has a check on unexpected files / directories.

In the past some files were kept in the install package, Piwik now identifies those unneeded items.

@bluesailor45
Copy link
Author

I tried to reinstall Piwik 2.6.1 (which is supported in Knapp App store), apply the mentioned fix to the module and rerun the upgrade process. However I got much too many error while upgrade. I will wait with the install/update until 3.xx is available in the Qnap app store.

@mattab mattab changed the title No access to PIWIK after upgrade to 3.0.1 Call to undefined function Piwik\fnmatch() in Feb 20, 2017
@mattab mattab changed the title Call to undefined function Piwik\fnmatch() in Call to undefined function Piwik\fnmatch() Feb 20, 2017
@mattab mattab added this to the 3.0.2 milestone Feb 20, 2017
@mattab mattab self-assigned this Feb 20, 2017
@Findus23 Findus23 mentioned this issue Nov 2, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants