Note that there are some explanatory texts on larger screens.

plurals
  1. POContent-type not working in PHP
    primarykey
    data
    text
    <p>I have some issues with a PHP file that is not working properly. The Content-type does not get recieved by any browser at all. Firebug interprets the file as text/html instead of css. Here's the file :</p> <pre><code>&lt;?php header('Content-Type: text/css; charset=UTF-8'); error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 'On'); /* CSS goes on from here */ </code></pre> <p>I tested to put a row with <code>echo 'TEST';</code> before the header line, and was expecting to see the classic "headers already sent" error, but nothing appears!</p> <p>Normal .css-files are working like a charm however.</p> <p>What can I do to sort this out?</p> <p><strong>UPDATE:</strong> Did change <code>default_mimetype = "text/html"</code> to <code>default_mimetype = "text/css"</code> in php.ini and all pages got immediately interpreted as css, so there's must be a way to just send css headers for this file :)</p> <p>The full file from demand of John:</p> <pre><code> &lt;?php header('Content-Type: text/css; charset=UTF-8'); echo 'body {background-color: #000000; }'; ?&gt; </code></pre> <p><strong>UPDATE #2:</strong> Adding <code>ini_set('default_mimetype', 'text/css');</code> to the PHP file fixes this file, but it doesn't solve the issue that causes this fault...</p> <p><strong>UPDATE #3:</strong> Tested adding <code>AddType text/css .css</code> to both .htaccess and Apache config. Still no luck. Also tested to send headers separated from charset: <code>header('Content-Type: text/css');</code> - Still no luck...</p> <p><strong>UPDATE #4:</strong> Have reinstalled Apache+PHP at the server to see if the problem goes away, but no. Same old, same old...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload