Home Backend Development PHP Tutorial PHP content-type=text/html problem_PHP tutorial

PHP content-type=text/html problem_PHP tutorial

Jul 13, 2016 pm 05:25 PM
html php text of question

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...
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

HTML Table Layout

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

See all articles