PHP的content-type=text/html问题
PHP的content-type=text/html问题
Patrick 2000年5月31日
把它EMAIL给我 我来谈谈我的看法 上一篇 下一篇
以下文字是由于小弟看到最近论坛上有关此类问题很多而写,还请各位多指教!!!
在本站的常见问题中已经有了怎样去掉PHP4的一些多余信息的解答,但是严格来说这些信息分成两部分:一部分是指明PHP正在运行的消息,就是那些什么X-POWERED-BY之类的;还有一部分是申明了该文件的默认内容形式text/html。常见问题中的解答解决了前一部分问题(只要在相关行加注就OK了),但是论坛上更多的是关于后一部分的问题,我想就这个问题探讨一下。
最开始要申明的是这样的情况很可能出现在PHP以CGI方式运行的时候,那么小弟猜想大部分是WIN32平台出错。
首先,一个最极端的解决方法就是,将所有扩展模块注释掉,即在php.ini中将那些关于数据库、图形、MAIL等等扩展模块均申明不加载,部分php.ini文件类似如下的形式:
;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd.dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll
那么如果需要这些模块怎么办?小弟我的解决办法只有在相应页面动态加载,即dl()上去——以前小弟我还寻思这个函数有什么用,现在,哈哈。。。如果各位有什么好办法,也可以张贴出来和大家分享!
其次一个解决的办法是利用PHP的-q参数,按照PHP自己的说法是“Suppress HTTP Header Output”即禁止HTTP头输出。这样倒是一了百了,但是你的任何header()和setcookie()都无用了——嘿嘿,你的PHP就基本报废。所以那,这只是一个龌鹾的办法了。
好了,就说这么多,应该可以解决CGI方式运行的PHP的以上问题了。以上资料综合了www.faqts.com的有关PHP部分——那个地方可以顶级的提问地盘了,经常有PHP/ZEND的撰写者和一些PHP书籍的作者回答你的问题,多棒阿!!!
欢迎各位指教!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c
