Table of Contents
回复内容:
Home Backend Development PHP Tutorial apache2.2输出html有异常

apache2.2输出html有异常

Jun 06, 2016 pm 08:47 PM
apache html php

本地站点测试完成之后,将代码clone到服务器上,服务器用的是windows server 2003
本地首页的代码是这样的
apache2.2输出html有异常

但是放到远端服务器上就变成这样了
apache2.2输出html有异常

远端的html里head标签的内容全跑到body里去了,而且body里一开始有一块很大的空字符串,造成了访问网站的时候最上面有一块很明显的空白,但是本地运行的是完全没有问题的,猜想是不是远端服务器的apache有问题,有没有哪位大大遇到过这样的情况的,需要做哪些配置,急求啊,预祝各位新春快乐~

回复内容:

本地站点测试完成之后,将代码clone到服务器上,服务器用的是windows server 2003
本地首页的代码是这样的
apache2.2输出html有异常

但是放到远端服务器上就变成这样了
apache2.2输出html有异常

远端的html里head标签的内容全跑到body里去了,而且body里一开始有一块很大的空字符串,造成了访问网站的时候最上面有一块很明显的空白,但是本地运行的是完全没有问题的,猜想是不是远端服务器的apache有问题,有没有哪位大大遇到过这样的情况的,需要做哪些配置,急求啊,预祝各位新春快乐~

参考一下这个帖子:
http://bbs.csdn.net/topics/380258641

附此楼猪最后解决问题的方案:

多谢大家,更谢谢wzhiyuan,我解决了,就是include的问题,包含的文件是utf-8编码的,但是有BOM头,我用一个函数把网站目录里的所有文件的BOM头去掉以后就恢复正常了,希望看到帖子的同志们以后遇到这样的问题不要跟我一样纠结了,顺便贴一下我去除BOM头的函数代码,希望大家能用上,不要像我一样纠结了
(...后面省略1000+字,卤煮自己去看吧)

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

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)

How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) Apr 08, 2025 am 12:03 AM

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

React's Role in HTML: Enhancing User Experience React's Role in HTML: Enhancing User Experience Apr 09, 2025 am 12:11 AM

React combines JSX and HTML to improve user experience. 1) JSX embeds HTML to make development more intuitive. 2) The virtual DOM mechanism optimizes performance and reduces DOM operations. 3) Component-based management UI to improve maintainability. 4) State management and event processing enhance interactivity.

The Future of PHP: Adaptations and Innovations The Future of PHP: Adaptations and Innovations Apr 11, 2025 am 12:01 AM

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

How to set character encoding on the server side to solve Bootstrap Table garbled How to set character encoding on the server side to solve Bootstrap Table garbled Apr 07, 2025 pm 12:00 PM

To set character encoding on the server side to solve the garbled Bootstrap Table, you need to follow the following steps: check the server character encoding; edit the server configuration file; set the character encoding to UTF-8; save and restart the server; verify the encoding.

HTML and Code: A Closer Look at the Terminology HTML and Code: A Closer Look at the Terminology Apr 10, 2025 am 09:28 AM

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

PHP: Is It Dying or Simply Adapting? PHP: Is It Dying or Simply Adapting? Apr 11, 2025 am 12:13 AM

PHP is not dying, but constantly adapting and evolving. 1) PHP has undergone multiple version iterations since 1994 to adapt to new technology trends. 2) It is currently widely used in e-commerce, content management systems and other fields. 3) PHP8 introduces JIT compiler and other functions to improve performance and modernization. 4) Use OPcache and follow PSR-12 standards to optimize performance and code quality.

See all articles