动态生成的CSS MIME类型无法识别

This seems to be a recurring issue, but none of the solutions I've found have worked for me.

I'm using a file, dashboardStyles.php, to generate my css.

I link to the file by

<link href="../styles/dashboardStyle.php" rel="stylesheet" type="text/css" /> 

The dashboardStyle.php file begins with

<?php
header('Content-type: text/css', true);
...

However, the browser gives a warning: Resource interpreted as Stylesheet but transferred with MIME type text/html

And the file type shows as html in chrome's network tab, and the CSS is not applied.

If I edit the file at all in the browser, all the CSS is applied. Also, strangely, if I execute any javascript before my html tags, it is also applied.

How can I get the content type header to be delivered & respected?