search
Homephp教程php手册为什么有时PHP程序会在开头显示:X-Powered-By: PHP/4.0.0之类的字符呢?

程序|显示

这是因为PHP。INI中有一些设置不对,最有可能是就是有无效的DLL文件在内。但为什么会出现这些呢?
我在WIN32下,建了一个空的test.php文件。
然后执行c:\php4\php.exe test.php,此时我的php.ini的配置是正确的。屏幕输出为:
X-Powered-By: PHP/4.0.0
Content-type: text/html
咦,这不是显示在屏幕上的东西吗?是的。但这时这两行是作HTTP信息头的。是不会显示在浏览器中的。

现在我在php.ini中加载了php_mysql.dll。而这个文件是不存在的。
再次执行c:\php4\php.exe test.php,屏幕输出为:
Content-type: text/html
PHP Fatal error: Unable to load dynamic library 'php_mysql.dll'

此处还有些乱字符
X-Powered-By: PHP/4.0.0
Content-type: text/html

就是在Content-type: text/html之后,又出现了一些错误信息,所以才导致X-Powered-By: PHP/4.0.0 Content-type: text/html出现在屏幕上。而这其实本来是HTTP的信息头的。

那么我想在出这些错时,如果output_buffering=off的话,那么setcookie()是没办法使用的。
明白了吗?



Statement
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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment