> ## Content Index
> Fetch the complete content index at: https://www.frank.be/llms.txt
> Use this file to discover other available public pages before exploring further.

# PHP: warning: gzdecode(): data error & magic quotes
- URL: https://www.frank.be/php-warning-gzdecode-data-error-magic-quotes/
- Published: 2017-10-17T12:23:41.000Z
- Updated: 2026-06-21T17:37:24.000Z
- Description: If you get gzdecode() errors in PHP, check if magic_quotes_runtime isn't enabled.
- Author: Frank Louwers
- Tags: php, evil

*This blogpost is in English because I lost a few hours with this problem, and Google didn't show any good results, so I hope to help mankind by writing this in English ...*

If you ever encounter the following error:

```
warning: gzdecode(): data error

```

when using the PHP gzdecode function, then please do yourself a favour, and check if you have `magic_quotes_runtime` set to `On`. If you do, set it to Off before you start recompiling php, libz, gzip, libjpeg or any other major lib or module.

[magic\_quotes\_runtime](http://php.net/manual/en/info.configuration.php?ref=frank.be#ini.magic-quotes-runtime) is evil and should never have been written. It seems the PHP community finally came to their senses, and removed it as of PHP 7.x. If enabled, it manipulates everything that PHP might see as a string, even blobs of binary that that happen to be assigned to a variable that might hold a string.

In short: do not ever use it, and if you get funky gzdecode() errors, check your `php.ini` file.