title: PHP configuration overriding the .htaccess caching headers
body: <p>I have been trying setting up caching for my site's static files like jpg, png, css etc. but getting no success so far, I figured out that PHP's configuration is taking over the .htaccess is config.</p>
  
  <p>I have verified that mod_expires.so is uncommented in my httpd.conf.</p>
  
  <p>I tried following in .htaccess but in vain.</p>
  
  <pre><code>&lt;IfModule mod_expires.c&gt;
  ExpiresActive On
  &lt;FilesMatch "\.(jpe?g|png|gif|js|css|ttf|eto|svg|woff|otf)$"&gt;
  ExpiresDefault "access plus 1 month"
  &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>even tried without success</p>
  
  <pre><code>&lt;FilesMatch "\.(flv|gif|jpg|jpeg|png|ico)$"&gt;
  Header set Cache-Control "max-age=2592000"
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>I then found that my php.ini has <code>session.cache_limiter = nocache</code> I changed it to <code>session.cache_limiter = public</code> and my <code>session.cache_expire=180</code>
  after changing this config in php.ini and restarting apache, I found that response header for images changed as below</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Fri, 19 Sep 2014 07:33:58 GMT
  Server: Apache/2.2.3 (CentOS)
  X-Powered-By: PHP/5.2.10
  Expires: Fri, 19 Sep 2014 10:33:58 GMT
  Cache-Control: public, max-age=10800
  Last-Modified: Mon, 05 Dec 2011 19:08:22 GMT
  Connection: close
  Transfer-Encoding: chunked
  Content-Type: text/html; charset=UTF-8
  </code></pre>
  
  <p>What I want to do is to cache the images and css/js files for "access plus 1 month"</p>
  
  <p>any suggestion is appreciated. </p>