I have Googled my heart out looking for an answer to this but cannot find one! I know it seems like a Stack Overflow sort of question but I didn't have these problems before I ran it through fastCGI which makes me think it is server related.

I have followed this tutorial: https://gist.github.com/gmodarelli/5887778 to use PHPFarm to set a different version of PHP for a specific vhost file.

The vhost file is as follows:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName dev.[site name]
    ServerAlias *.[site name]

    VirtualDocumentRoot /files/web/%1/public_html


<Directory /files/web>

    AddHandler php-cgi .php
    Action php-cgi /cgi-bin-php/php-cgi-5.6.25

    <FilesMatch "\.php">
        SetHandler php-cgi

    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
    Require all granted

I am trying to run Magento, something I have done many times before, but CSS is not being loaded and am getting the following in the dev console:

Resource interpreted as Stylesheet but transferred with MIME type text/html

The response header for the file is:

Content-Type:text/html; charset=UTF-8
Date:Fri, 06 Jan 2017 02:26:28 GMT
Keep-Alive:timeout=5, max=99
Server:Apache/2.4.18 (Ubuntu)

Request header:

Accept-Encoding:gzip, deflate, sdch
Cookie:magento_downloader_session... blah blah
Host:magento.[site name]
Referer:http://magento.[site name]/downloader/
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

I have tried adding

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|ico|png)$ \ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ \no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

But this didn't work.

I have tried setting

zlib.output_compression_level = -1


zlib.output_compression_level = 6

in php.ini. No dice.

I have added AddType text/css css to the root htaccess file but, again, no luck.

I am running thin on Google search terms and patience! Can anyone help me with this please?


I have just tried setting all of the permissions to files: 664 and folders 775 but still not working.

Another Update

Just as a test i have commented out the lines

AddHandler php-cgi .php
Action php-cgi /cgi-bin-php/php-cgi-5.6.25

<FilesMatch "\.php">
    SetHandler php-cgi

This fixed the issue but, obviously, stops using the version of PHP I need

Any help at all on this would be amazing. Please!

  • It looks like you are serving CSS via PHP, rather than as static files. Are you sure that is what you intended? – Michael Hampton Jan 6 '17 at 3:26
  • Definitely not. I am just looking into the `<FilesMatch> directive to see if there is anything wrong in there – Wildcard27 Jan 6 '17 at 3:27
  • Usually when that happens, your DocumentRoot is wrong. – Michael Hampton Jan 6 '17 at 3:28
  • @MichaelHampton The DocumentRoot is working all of the other files are being loaded. Do you see anything wrong with the VHost file above? – Wildcard27 Jan 6 '17 at 3:30
  • Come on guys. There has to be someone out there who can help with this! – Wildcard27 Jan 7 '17 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.