PHP Errors in server log
-
My server logs are full of these errors:
FastCGI sent in stderr: "PHP message: PHP Notice: iconv(): Detected an illegal character in input string in /var/www/example.com/htdocs/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php on line 296;
-
Hi @qrokes can you tell me if you’re using MaxMind’s GeoIp database? If so, can you tell me which one(s)?
Hi, @dizzyatinnocraft thanks for your fast response.
No, I’m not using MaxMind.
One other question, are you seeing data in the Matomo location reports (ie, the reports in the
Matomo Analytics > Reporting > Visitors > Locationspage)?And one other question: what version of the plugin are you using?
Version: 5.1.0
Yes, I can see the “Visitors – Locations” report.
Can you try replacing the
/path/to/wordpress/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.phpfile with the contents of this one: https://raw.githubusercontent.com/matomo-org/matomo-for-wordpress/b4a7ef4c53d8dec0d2bbd790fb21919ca328c86d/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php and see if the notice goes away?Actually, ignore that last message.
Ok, instead, can you try replacing the
/path/to/wordpress/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.phpfile with the contents of this one: https://raw.githubusercontent.com/matomo-org/matomo-for-wordpress/2cdc997527b204867e36bc4a722bbd942bd8d849/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php ?Ok. Today I updated from 5.0.8 to 5.1.0, so first let me see the logs with this new update. If tomorrow I still see the same error, then I will try the new code you posted.
I can confirm that this issue is still happening in v5.1.0. It happens in the middle of the night when nobody is logged in using the WP admin area.
PHP message: PHP Notice: iconv(): Detected an illegal character in input string in /var/www/example.com/htdocs/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php on line 295; PHP message: PHP Notice: iconv(): Detected an illegal character in input string in /var/www/example.com/htdocs/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php on line 295" while reading response header from upstream, client: 88.130.127.37, server: example.com, request: "POST /wp-content/plugins/matomo/app/matomo.php?action_name=Optimized%20Page%20Web%20Home%20%C2%BB%20Example&idsite=1&rec=1&r=256400&h=10&m=34&s=59&url=https%3A%2F%2Fwebinoly.com%2F&_id=f18246f38be07d15&_idn=0&send_image=0&_refts=0&pv_id=tsGSVB&pf_net=275&pf_srv=160&pf_tfr=144&pf_dm1=498&uadata=%7B%22fullVersionList%22%3A%5B%7B%22brand%22%3A%22Google%20Chrome%22%2C%22version%22%3A%22125.0.6422.176%22%7D%2C%7B%22brand%22%3A%22Chromium%22%2C%22version%22%3A%22Using the modified file you sent me, I’m now getting a new error:
FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot declare class Piwik\Plugins\GeoIp2\LocationProvider\GeoIp2\Php, because the name is already in use in /var/www/example.com/htdocs/wp-content/plugins/matomo/app/plugins/GeoIp2/LocationProvider/GeoIp2/Php2.php on line 29" while reading response header from upstream, client: 186.122.88.17, server: example.com, request: "POST /wp-content/plugins/matomo/app/matomo.php?action_name=Nginx%20y%20las%20limitaciones%20de%20FastCGI%20Cache%20%C2%BB%20Ejemplo&idsite=1&rec=1&r=055560&h=14&m=6&s=56&url=https%3A%2F%2Fexample.com%2Fes%2Ftutorial%2Fnginx-purge-fastcgi-cache%2F&urlref=https%3A%2F%2Fwww.google.com%2F&_id=0204683d1b4caf91&_idn=0&send_image=0&_refts=1718816816&_ref=https%3A%2F%2Fwww.google.com%2F&pv_id=5yN8ub&pf_net=0&pf_srv=1&pf_tfr=8&pf_dm1=178&uadata=%7B%22fullVersionList%22%3A%5B%7B%22brand%22%3A%22Not%2FA)Brand%22%2C%22version%22%3A%228.0.0.0%22%7D%2C%7B%22brand%22%3A%22Chromium%22%2C%22version%22%3A%22126.0.6478.61%22%7D%2C%7B%22brand%22%3A%22Google%20Chrome%22%2C%22version%22%3A%22126.0.6478.61%22%7D%5D%2C%22mobile%22%3Afalse%2C%22model%22%3A%22%22%2C%22platform%22%3A%22Windows%22%2C%22platformVersion%22%3A%2215.0.0%22%7D&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=1920x1080 HTTP/3.0", upstream: "fastcgi://127.0.0.1:9000", referrer: "https://example.com/es/tutorial/nginx-purge-fastcgi-cache/"@qrokes there shouldn’t be a “Php2.php” file there, did you copy the original for a backup? Or save it as “Php2.php”? Either remove Php2.php or rename it to something like “Php2.php.backup” while ensuring the updated code is in the “Php.php” file.
After a couple of days of using your modified file, I think is safe to say that the issue is solved, I have no errors in the server logs.
I hope this fix can be included in the next release.
@qrokes this issue is in the core product, so a proper fix will have to be done by the team that manages that. But in the meantime, we will patch Matomo for WordPress until that fix is created and released so the problem should not reoccur.
The topic ‘PHP Errors in server log’ is closed to new replies.