• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved JSON encoding issue - Plugin using PHP "download_url()"

Dec@de42

New Pleskian
Hey everyone,
I am relatively new to Plesk and hosting my Server and to this forum, so forgive me if this is the wrong sub-forum or prefix ;)

So far, everything went relatively smooth with my new Plesk server, thanks to the good UI & this fabulous forum :D

But I have a very wired issue, which I am unable to investigate myself:
All my WordPress-Websites are using a Plugin called "Complianz". This plugin is downloading JSON files to Home directory>httpdocs>wp-content>uploads>complianz>cmp>vendorlist>fileXXX.json
I already was in contact with the Plugin Developers, they are using the WordPress function "download_url()", which almost always works as intended. < But not in my case, I guess ;)
The Encoding is off, so the file just display gibberish characters instead of strings (viewing via FTP)
1638816357044.png

The non-JSON files in this folder (CSS, etc.) look good (no encoding issues) and are also regularly updated by Complianz (like the JSON files).

Does anyone have an idea what might be causing this issue? I know for sure this has to do with my new Plesk server because on my old site hosted at Kinsta, this issue is not present.

Error logs look clean so far, no error for the timespan when the Plugin downloads the files. I also use imunify360, but no incidents or anything occurred during this time-period.
PHP encoding is set to UTF-8.

Thanks in advance
 
After investigating a little further, this seems to be an output buffering or gzip problem?

From the Support:
I put one of the weirdly encoded JSON files into this tool as input, and then picked Dechunk HTTP response > Detect file type.

m7hzjogurqqHwi5Gqbh0xfEEIhtYtRP-BbmVrw0V7ROowmEqlPaDPOPwzJK55HZsdgvGMkCjAEa5Icfdv10dTPW1G9ck3fKJ4iVRA6ks6YWTzec4QPlI769v9UjFhuWnD-POqrof3-mcs7B33Z9Y8baxjQax706lBYBqcYmsq9C-_loPoym6rYPq0k24a8VPC96OhzdQoP-KfCTK1kOLUIta1UTEs4FGwoX87f61OkY1SXo9Fc-EsOO-sSI4cOi6ZuGm_IBfUI4=s0-d-e1-ft

Which tells us that it likely concerns a gzipped file....

I haven't configured anything special, and this is nginx only configuration. So i guess it's not an .htaccess issue.


What is also kind of wired, that all the files are an exact multiple of 4kb. Might just be the server block size, of course, but it's looking suspicious:
1639153766303.png

But the real issue is still, that the files are not valid & way to small. (I attached them to this post)

Does that ring a bell on somebody's mind?
Any help or tip would be highly appreciated!
 

Attachments

  • InvalidFiles.zip
    297.6 KB · Views: 1
Hey Guys,
in case anyone hast this problem again:

As it turns out, the plugin seems to use the function curl_exec which was disabled in my php.ini. Now i removed curl_exec from "disable_functions" and everything works fine.
 
Back
Top