简体   繁体   English

PHP的apache_setenv函数导致500内部服务器错误

[英]PHP's apache_setenv function causes 500 Internal Server Error

apache_setenv ( 'no-gzip', 1 )

I'm trying to disable gzip for a certain page's output, but only that page. 我正在尝试为特定页面的输出禁用gzip,但仅禁用该页面。 This works fine on testing servers, but not the production server, which is running the same thing (CentOS and Apache), works on Ubuntu though. 这在测试服务器上工作正常,但在同一服务器(CentOS和Apache)上运行的生产服务器却不能在Ubuntu上运行。

Anyway, do you know why? 无论如何,你知道为什么吗? Or is there some other alternative? 还是有其他选择?

I was thinking of using ob_start () to put all output in a buffer, and then unzip it myself with a PHP function then call ob_end_flush ()... or would it not be gzipped until right before Apache sends it to the client? 我当时正在考虑使用ob_start()将所有输出放入缓冲区,然后使用PHP函数自己将其解压缩,然后调用ob_end_flush()...,或者直到Apache将其发送到客户端之前,它才会被压缩吗?

Thanks for any help. 谢谢你的帮助。

请确认php是作为模块而不是cgi-extension运行的,并且必须禁用安全模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM