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

Comments

Projects
None yet
5 participants
@bluesailor45
Copy link

commented Jan 19, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2017

What OS are you running this on?

@bluesailor45

This comment has been minimized.

Copy link
Author

commented Jan 20, 2017

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

This comment has been minimized.

Copy link
Author

commented Jan 28, 2017

No solution to that 😳???

@CheweyZ

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Author

commented Jan 30, 2017

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

@tsteur

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Feb 4, 2017

@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

This comment has been minimized.

Copy link
Author

commented Feb 4, 2017

@RMastop

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Author

commented Feb 4, 2017

@RMastop

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Author

commented Feb 4, 2017

@RMastop

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Author

commented Feb 5, 2017

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

mattab added a commit that referenced this issue Feb 20, 2017

mattab added a commit that referenced this issue Feb 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.