douyue1926 2012-07-20 15:31
浏览 23
已采纳

.js.php文件扩展名在文件末尾添加了奇怪的字符

I have an Ubuntu server with a LAMP stack. I have some javascript that has a php include in the middle of it.

For the past year the code has worked fine, but now there is a strange set of characters appearing at the end when viewed in a browser:

It seems to be connected to the .js.php file extension. I can simplify it down to:

In notepad++ it show that there are a couple of extra characters that are actually there:

enter image description here

Its not a standard PHP openend bracket < which might make sense.

Hunting for '.js.php' or the characters in Google is pretty fruitless, so I'm completely stuck.

  • 写回答

1条回答 默认 最新

  • douping3891 2012-07-31 13:30
    关注

    I had this problem too. The problem seems to be caused by the server gzipping the response incorrectly. (With mod_deflate of course).

    Disabling mod_deflate through .htaccess resolved the issue for me - note that you can do something like this to disable per filetype:

    SetEnvIfNoCase Request_URI \.*\.js\.php$ no-gzip dont-vary
    

    Strangely, I have two supposedly identical Ubuntu VMs - one where everything runs perfectly, and one where I need to disable mod_deflate. If anyone can figure why this is happening, I'd be interested to know!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)