duannei1477 2013-10-03 12:41
浏览 65

动态CSS(带有php标题)不能在Linux中呈现(薄荷) - 它在Windows中运行良好

I have a dynamic CSS (with some values and class/id names provided by php). the file begins with:

header("Content-type: text/css; charset: UTF-8");
require("../../_Config/config.php");

The directory structure is (to determine the relative position of config.php and css.php files):

ROOT
    -[_Config]
      -config.php

    -[_Viewer]
        -[css]
          -css.php

I have Linux Mint 15 installed, with apache and (some) mods enabled - I noticed that headers mod wasn't enabled... and I enabled it, but that didn't helped. I get the css file in client, but is plain and empty. Strange fact is that under Windows XAMPP it works fine.

Any suggestions here? Maybe the relative path is faulty? I tried several combinations, but neither worked (as I have to go up in the parent, to access config.php i thought it may be part of the problem).

I'm just accommodating with linux, so it's possible that solution to be very simple... or not. Anyway, if you need more details that i may have skipped here, please ask.

EDIT:
Just a thought: could be a Linux permissions issue? - if so, what would be the suggested workarounds, considering that my site is located in /var/www/ and php is running under www-data user at this moment. Is it wise to chanve apache ownership?

EDIT 2
Checked header requests in Firebug - this one is for my file

Connection    close
Content-Encoding  gzip
Content-Length    20
Content-Type  text/css; charset: UTF-8
Date  Thu, 03 Oct 2013 15:04:54 GMT
Server    Apache/2.2.22 (Ubuntu)
Vary  Accept-Encoding
X-Powered-By  PHP/5.4.9-4ubuntu2.3
Request Headersview source
Accept    text/css,*/*;q=0.1
Accept-Encoding   gzip, deflate
Accept-Language   en-US,en;q=0.5
Connection    keep-alive
Cookie    PHPSESSID=3ohou7v772o20i72rli3iofdq6
Host  192.168.1.99
Referer   http://192.168.1.99/index.php
User-Agent    Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101
Firefox/24.0
  • 写回答

2条回答 默认 最新

  • duanmianxue2687 2013-10-03 12:52
    关注

    This can be happened due to cache problems with vagrant, vm and linux. you can add the request parameter in the url

    example

    <link src="http://www.example.com/abc.php?v=1.0" > instead of <link src="http://www.example.com/abc.php" >.
    
    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程