• Resolved adcgn

    (@adcgn)


    Since I installed the plugin, I receive lots of PHP warnings because some PHP functions have been disabled by my hosting provider:

    PHP Warning: getmypid() has been disabled for security reasons in /wp-content/plugins/matomo/app/core/CliMulti/Process.php on line 96

    I checked the content of the mentioned file, and it records the running process id in a semaphore file. This might not work in all environments, as you can see here. If I call the getmypid() function directly, it returns nothing and exits with code 254. That might not be the result the plugin expects. As a result, I am unsure about the meanings of the results in the frontend. I feel some information is missing, but I cannot verify.

    I checked with my hosting provider, and they have never seen a plugin using that PHP function – until today. It is quite unusual for a plugin. You might consider using a different semaphore process so that it runs on all environments.

    I disabled the plugin so far because of the numerous warnings in my log files.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Thomas

    (@tsteur)

    Hi @adcgn

    thanks for reporting this and sorry about all the numerous warnings in your log files.

    Technically, this should not happen as we check if getmypid is supported here: https://github.com/matomo-org/wp-matomo/blob/4.0.4/app/core/CliMulti/Process.php#L172-L184

    It’s possible though that maybe your hoster supported getmypid for web requests but not on CLI when we execute it on the command line. Any chance you could send us the Matomo system report see https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/ either as a comment here (it should be anonymised) or by email to [email protected]?

    Generally, you should be able to fix this by adding define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false); to wp-config.php.

    Thread Starter adcgn

    (@adcgn)

    Hi @tsteur,

    I use a managed WordPress Hosting. Meanwhile, I switched to the external hosting of Matomo and, thus, switched the plugins. That works without issues. For testing purposes, I installed the plugin again. Here are the details (I removed any unrelated stuff). I hope it helps.

    # Matomo

    * Matomo Pluginversion: 4.0.4
    * Config existiert und ist beschreibbar.: Ja (“$ABSPATH/wp-content/uploads/matomo/config/config.ini.php” )
    * JS Tracker existiert und ist beschreibbar.: Ja (“$ABSPATH/wp-content/uploads/matomo/matomo.js” )
    * Plugin-Verzeichnisse: Yes ([{“pluginsPathAbsolute”:”$ABSPATH\/wp-content\/plugins\/matomo\/plugins”,”webrootDirRelativeToMatomo”:”..\/”}])
    * Tmp-Verzeichnis schreibbar: Yes ($ABSPATH/wp-content/cache/matomo)
    * Matomo-Version: 4.0.5
    * Matomo Blog idSite: 1
    * Installierte Matomo-Version: 4.0.4 (Install date: 2020-12-11 19:08:32)
    * Upgrades outstanding: No
    * Upgrade in progress: No

    ## Endpoints

    * Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js)
    * Matomo JavaScript Tracker – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)
    * Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php)
    * Matomo HTTP Tracking API – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)

    ## Crons

    * Server-Zeit: 2020-12-11 18:10:52
    * Blog-Zeit: 2020-12-11 19:10:52 (Die nachfolgenden Daten werden in der Blog-Zeitzone angezeigt)
    * Sync users & sites: Next run: 2020-12-12 19:08:31 (23 Stunden 57 Minuten) ( Last started: 2020-12-11 19:10:26 (-26 Sek.). Last ended: 2020-12-11 19:10:26 (-26 Sek.). Interval: daily)
    * Archive: Next run: 2020-12-11 20:08:31 (57 Minuten 39s) ( Last started: 2020-12-11 19:10:26 (-26 Sek.). Last ended: 2020-12-11 19:10:41 (-11 Sek.). Interval: hourly)
    * Update GeoIP DB: Next run: 2021-01-10 19:08:31 (29 Tage 23 Stunden) ( Last started: 2020-12-11 19:10:41 (-11 Sek.). Last ended: 2020-12-11 19:10:44 (-8 Sek.). Interval: matomo_monthly)

    ## Vorgeschriebene Prüfungen

    * PHP-Version >= : ok
    * PDO Erweiterung: ok
    * PDO\MYSQL Erweiterung: ok
    * MYSQLI Erweiterung: ok
    * Weitere erforderliche Anforderungen: ok
    * Erforderliche Funktionen: ok
    * Ben?tigte PHP Konfiguration (php.ini): ok
    * Verzeichnisse mit Schreibzugriff: ok
    * Verzeichnisse mit Schreibzugriff auf Tag Manager: ok

    ## Optionale Prüfungen

    * Tracker-Status: ok
    * Speicherlimit: ok
    * Zeitzone: ok
    * ?ffnen einer URL: ok
    * PageSpeed deaktiviert: ok
    * GD > 2.x + Freetype (graphics): ok
    * Andere Erweiterungen: ok
    * Warning Andere Funktionen: warning (shell_exec Sie müssen diese eingebaute Funktion aktivieren set_time_limit mail parse_ini_file glob gzopen md5_file )
    * Dateisystem: ok
    * Letzter erfolgreicher Abschluss der Archivierung: ok
    * Datenbankf?higkeiten: ok
    * Warning Maximale Packetgr??e: warning
    * Standorterkennung: ok
    * Update über HTTPS: ok
    * Schreibbarer JavaScript-Tracker (“/matomo.js”): ok
    * Supports Async Archiving: No
    * Location provider ID: geoip2php
    * Location provider available: Yes
    * Location provider working: Yes

    ## Matomo Settings

    * Track mode: default
    * Track codeposition: footer
    * Track api endpoint: default
    * Track js endpoint: default
    * Version history: 4.0.4
    * Core version: 4.0.5
    * Last tracking settings update: 1607710226
    * Last settings update: 1607710226

    ## Logs

    # WordPress

    * Home URL: $site_url
    * Site URL: $site_url
    * WordPress Version: 5.6
    * MATOMO_SUPPORT_ASYNC_ARCHIVING: –
    * MATOMO_TRIGGER_BROWSER_ARCHIVING: –
    * MATOMO_ENABLE_TAG_MANAGER: –
    * MATOMO_SUPPRESS_DB_ERRORS: –
    * MATOMO_ENABLE_AUTO_UPGRADE: –
    * MATOMO_DEBUG: –
    * MATOMO_SAFE_MODE: –
    * MATOMO_GLOBAL_UPLOAD_DIR: –
    * MATOMO_LOGIN_REDIRECT: –
    * Permalink Structure: /%category%/%postname%/
    * Compatible content directory: Yes

    # WordPress Plugins

    ## Plugins

    * LiteSpeed Cache: 3.5.2
    * Matomo Analytics – Ethical Stats. Powerful Insights.: 4.0.4

    # Server

    * Server Info: LiteSpeed
    * PHP OS: Linux
    * PHP Version: 7.4.6
    * PHP SAPI: litespeed
    * PHP Binary Name: lsphp
    * Timezone: UTC
    * WP timezone: Europe/Berlin
    * Locale: de_DE
    * User Locale: de_DE
    * Memory Limit: 256M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
    * WP Memory Limit: 40M
    * WP Max Memory Limit: 256M
    * Max Execution Time: 60
    * Max Post Size: X
    * Max Upload Size: X
    * Max Input Vars: 10000
    * Disabled PHP functions: Yes (getmypid, passthru, leak, listen, diskfreespace, link, ignore_user_abord, shell_exec, dl, exec, system, highlight_file, source, show_source, fpaththru, virtual, posix_ctermid, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix, _getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_times, posix_ttyname, posix_uname, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, phpinfo, eval)
    * zlib.output_compression is off: Yes
    * Curl Version: 7.62.0, OpenSSL/1.0.2k

    Plugin Author Thomas

    (@tsteur)

    Great, thanks for doing this @adcgn and it really helps. Our patch might actually work in this case and we’ll also have another test with this. Thanks again and have a great week.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning: getmypid() has been disabled’ is closed to new replies.