PHP content-type=text/html problem_PHP tutorial

WBOY
Release: 2016-07-13 17:25:57
Original
949 people have browsed it

PHP content-type=text/html problem
Patrick May 31, 2000

Email it to me and I will talk about my views Previous articleNext article


The following text was written because I saw a lot of such questions on the forum recently. Please give me your advice! ! !

In the FAQ of this site, there are already answers on how to remove some redundant information of PHP4, but strictly speaking, this information is divided into two parts: one part is the message indicating that PHP is running, which is what X- POWERED-BY and the like; another part declares the default content format of the file, text/html. The answers in the FAQ solve the first part of the problem (as long as you add a comment in the relevant line), but the forum is more about the latter part, and I would like to discuss this issue.

The first thing I want to state is that this situation is likely to occur when PHP is running in CGI mode, so I guess it is mostly an error on the WIN32 platform.

First of all, one of the most extreme solutions is to comment out all extension modules, that is, declare in php.ini that those extension modules related to databases, graphics, MAIL, etc. will not be loaded, and some php.ini The file is similar to the following form:
;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
So what if you need these modules? Brother, my solution is to dynamically load the corresponding page, that is, dl() - before, I was wondering what the use of this function is, but now, haha. . . If you have any good ideas, you can post them and share them with everyone!

The second solution is to use PHP's -q parameter. According to PHP itself, it is "Suppress HTTP Header Output", which means prohibiting HTTP header output. This will solve the problem once and for all, but any of your header() and setcookie() will be useless - hehe, your PHP will basically be scrapped. So, this is just a dirty approach.

Okay, that’s all, it should be able to solve the above problems of PHP running in CGI mode. The above information is combined with the PHP part of www.faqts.com - that place is the top forum for asking questions. PHP/ZEND writers and authors of some PHP books often answer your questions. How great! ! !

We welcome your advice!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532020.htmlTechArticlePHP content-type=text/html problem Patrick May 31, 2000 Email it to me and I will do it Let’s talk about my views. Previous article Next article The following text is because I saw something like this on the recent forum...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!