title: PHP | Getting ERR_CONTENT_DECODING_FAILED in Ajax request
body: <p>I'm getting that silly error when calling an ajax request, and when I open the URL of the Ajax in the browser, I get the same error.</p>
  
  <p><a href="https://i.stack.imgur.com/CoOQK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CoOQK.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/IA7YE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IA7YE.png" alt="enter image description here"></a></p>
  
  <p>I've been in this for 2 months.
  I removed my <strong>.htaccess</strong> and nothing changed.
  This is happening only on local environment, not on production.</p>
  
  <p>I tried adding </p>
  
  <pre><code>zlib.output_compression = On;
  </code></pre>
  
  <p>to my <strong>php.ini</strong> but did not change anything.</p>
  
  <p>I'm using Opencart 2.2.0.0 | PHP 5.6 | Ubuntu LAMP</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>This is the code called via ajax:-</p>
  
  <p><a href="https://i.stack.imgur.com/BVc0X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BVc0X.png" alt="enter image description here"></a></p>
  
  <p>if I add a <strong>print_r($data);</strong> it prints the data array, but the issue occurs when it tries to return the rendered content of the view file, I tried to create another view file but got the same response.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Here is the request from devTools > network tab:-</p>
  
  <p><a href="https://i.stack.imgur.com/y1FGV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y1FGV.png" alt="enter image description here"></a></p>
  
  <p>and the response tab is empty, no response it returned.</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p><a href="https://i.stack.imgur.com/YoasU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YoasU.png" alt="enter image description here"></a></p>