apache2.2输出html有异常
本地站点测试完成之后,将代码clone到服务器上,服务器用的是windows server 2003
本地首页的代码是这样的
但是放到远端服务器上就变成这样了
远端的html里head标签的内容全跑到body里去了,而且body里一开始有一块很大的空字符串,造成了访问网站的时候最上面有一块很明显的空白,但是本地运行的是完全没有问题的,猜想是不是远端服务器的apache有问题,有没有哪位大大遇到过这样的情况的,需要做哪些配置,急求啊,预祝各位新春快乐~
回复内容:
本地站点测试完成之后,将代码clone到服务器上,服务器用的是windows server 2003
本地首页的代码是这样的
但是放到远端服务器上就变成这样了
远端的html里head标签的内容全跑到body里去了,而且body里一开始有一块很大的空字符串,造成了访问网站的时候最上面有一块很明显的空白,但是本地运行的是完全没有问题的,猜想是不是远端服务器的apache有问题,有没有哪位大大遇到过这样的情况的,需要做哪些配置,急求啊,预祝各位新春快乐~
参考一下这个帖子:
http://bbs.csdn.net/topics/380258641
附此楼猪最后解决问题的方案:
多谢大家,更谢谢wzhiyuan,我解决了,就是include的问题,包含的文件是utf-8编码的,但是有BOM头,我用一个函数把网站目录里的所有文件的BOM头去掉以后就恢复正常了,希望看到帖子的同志们以后遇到这样的问题不要跟我一样纠结了,顺便贴一下我去除BOM头的函数代码,希望大家能用上,不要像我一样纠结了
(...后面省略1000+字,卤煮自己去看吧)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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



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.

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

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.

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

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.
