Error 330 (net::ERR_CONTENT_DECODING_FAILED):

Error 330 (net::ERR_CONTENT_DECODING_FAILED):

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Error 330 (net::ERR_CONTENT_DECODING_FAILED): Diagnosing Compression Mismatches on OpenX

Encountering Error 330 (net::ERR_CONTENT_DECODING_FAILED) in Chrome or the "invalid form of compression" message in Firefox immediately after a server migration is a classic symptom of a PHP output handler mismatch. The browser expects compressed content, but the server failed to deliver it—or delivered uncompressed content when the client requested gzip/deflate.

In the scenario described involving OpenX, this specific error usually points to a configuration drift between the application's expectations and the server's environment, rather than database corruption alone. While repairing the session table fixed one aspect of the crash, the compression issue stems from how PHP handles output buffering and headers.

The Root Cause: Output Compression Mismatch

The core mechanism behind this error is the interaction between zlib.output_compression in php.ini and the web server's configuration. When a script sets the Content-Encoding: gzip header, the browser attempts to decompress the stream. If the PHP handler fails to compress the data despite the header being set, or if the compression algorithm used by PHP differs from what the browser expects, the decoding fails.

In older versions of OpenX, specifically around version 2.8 and prior, there were known dependencies on specific legacy extensions. The source material highlights that OpenX requires the ZLib extension to handle compressed Flash files. While this is primarily for content within assets, the presence or absence of the zlib extension directly impacts the PHP output compression settings. If zlib.output_compression is enabled in php.ini but the zlib.so extension is missing or misconfigured (a common issue after a fresh server install), PHP will attempt to compress output using a fallback method that browsers often cannot decode correctly, leading to Error 330.

Verifying PHP Extensions and Settings

Before diving into complex rewrite rules, you must ensure the foundational extensions required by OpenX are active. According to the system requirements for OpenX 2.8, the following extensions are non-negotiable:

  1. ZLib: Essential not just for Flash assets, but often required for standard output compression functionality in older PHP versions.
  2. GD: Required for generating graphs on the Home page. If missing, statistics will be broken, though this is distinct from the compression error.
  3. OpenSSL or SSL-enabled Curl: Critical for secure login pages.

To verify if the ZLib extension is loaded, check your PHP environment:

php -m | grep zlib

If zlib is not listed, you must install it via your package manager (e.g., apt-get install php-zlib on Debian/Ubuntu or yum install php-zlib on CentOS). Once installed, restart Apache or Nginx and verify the module loads.

Additionally, check for conflicts with server-level compression. If your web server (Apache or Nginx) has Gzip enabled in its configuration (e.g., mod_gzip or nginx_gzip_static), and PHP also tries to apply output compression via zlib.output_compression, you risk double-compression or header collisions.

Configuration Trade-offs in php.ini

The most common resolution for this specific error involves modifying the php.ini file. You have two main strategies depending on your server setup:

Strategy A: Disable PHP Output Compression

If your web server is already handling compression efficiently, disable PHP's internal handler to prevent conflicts. Add or uncomment the following line in php.ini:

zlib.output_compression = Off

Note: In some environments, you may need to set implicit_flush to On to ensure headers are sent correctly without buffering issues.

Strategy B: Ensure Consistent Encoding

If PHP must handle compression (e.g., if the web server isn't configured for it), ensure that zlib.output_compression is On. However, you should verify that the output handler does not conflict with ob_start(). In OpenX, legacy code often relies on specific output buffering. If zlib.output_compression is enabled, it can sometimes interfere with custom ob_start() calls used by the application to render graphs or flash content.

A safer approach in modern setups is to let the web server handle compression and keep PHP's output compression off. This avoids the "invalid form of compression" scenario where PHP might be applying a different algorithm than the browser anticipates.

Conclusion and Next Steps

If you have confirmed that the ZLib extension is installed, magic_quotes_runtime and safe_mode are correctly set (both should be off in modern contexts), and zlib.output_compression is disabled in favor of server-side compression, the error should resolve itself.

In cases where the migration involved switching from PHP 5 to PHP 7 or 8, note that OpenX 2.8 was designed for older PHP versions. The source material explicitly states that mysqli is not supported; if you attempted to migrate using modern mysqli drivers without ensuring compatibility, extension loading could fail silently, causing the compression layer to drop. Always cross-reference your exact OpenX version against the specific PHP version requirements before applying generic fixes. If the error persists after checking extensions and php.ini, inspecting error.log for specific warnings regarding "implicit flush" or "output buffering" will provide the definitive clue needed to stabilize the dashboard view.

Our network