PHP content-type=text/html problem_PHP tutorial
Jul 13, 2016 pm 05:25 PM
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!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

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

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian
