search
HomeBackend DevelopmentPHP TutorialIE9打不开php页面,大神请帮忙

我在WAMP环境下写代码,IE9运行php页面每次都弹出一个下载的对话康,但是我用360浏览器能够正常解析!另外所有网上其它的php页面我的IE9也老是弹出一个下载的对话框,但是360能正常显示!这是什么原因,网上找了会也找不到原因,有哪位大神能帮帮忙吗??????


回复讨论(解决方案)

没配置content-type

火狐下如何? 
怎么访问的? php文件有没有放入跟目录下?

文件在apache服务器的位置肯定是没问题的,因为360浏览器都能访问嘛,而且不只是我写的打不开,网上其他的php页面也打不开!但是360浏览器可以!火狐浏览器我没试过,但是既然有浏览器能打开那就不是网页的问题吧,可能是IE9缺少了个什么东西,但是又找不到具体是什么

喜欢PHP,我的第一次回帖。

没配置content-type

不知道你说的没有配置是不是这个:

我也是php新手,这个是默认的!我代码中没写这个。然后我把这行代码加进去了,没用!两个浏览器还是一个能打开一个不能!

其实我更多的认为应该是我的IE9配置问题,可能少了个什么东西!当然还是希望大家多多指导……

本帖最后由 xuzuning 于 2012-10-06 11:08:35 编辑

对于用IE9老是弹出一个下载的对话框的url
你执行如下代码:
$s = file_get_contents('真实的url');
echo base64_encode(substr($s, 0, 100));
贴出结果

或者给出有效的链接


这个应该是你没有把php文件放到apache的www(或者设置的虚拟目录)目录下吧,至于360浏览器能打开,我一直觉得360的产品一直都挺神奇的,还有在没有php服务器的情况下,非IE内核的浏览器能以乱码的形式打开php文件

对于用IE9老是弹出一个下载的对话框的url
你执行如下代码:
$s = file_get_contents('真实的url');
echo base64_encode(substr($s, 0, 100));
贴出结果

或者给出有效的链接
按照你说的在360浏览器下我运行了一个URL(自己的一个比较简单的URL),输出的结果就这样的,表示看不懂
另外用IE9运行一下还是不行,依旧弹出下载对话框

对于用IE9老是弹出一个下载的对话框的url
你执行如下代码:
$s = file_get_contents('真实的url');
echo base64_encode(substr($s, 0, 100));
贴出结果

或者给出有效的链接



按照你说的在360浏览器下我运行了一个URL(自己的一个比较简单的URL),输出的结果就这样的,表示看不懂
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0M另外用IE9运行一下还是不行,依旧弹出下载对话框

这个应该是你没有把php文件放到apache的www(或者设置的虚拟目录)目录下吧,至于360浏览器能打开,我一直觉得360的产品一直都挺神奇的,还有在没有php服务器的情况下,非IE内核的浏览器能以乱码的形式打开php文件

我的php文件放置在D:\Apache\htdocs中,我是在自己的电脑上弄的,没有www目录。另外我也安装了php。我以前也在WAMP环境下写过,当时(当时的电脑和现在不同)IE9是可以运行的。所以我也奇怪,我觉得大多数是因为我的IE9缺少了点什么。

我知道是怎么回事,
php.ini文件配置不对,加载php扩展的dll文件部分不正确。楼主,你还是检查php运行环境。

我知道是怎么回事,
php.ini文件配置不对,加载php扩展的dll文件部分不正确。楼主,你还是检查php运行环境。

还是不对,我之前的确是有些dll加载了,有些没有加载。然后听从您的意见把所有的dll都加载了,但是还是不行,同样的问题依旧出现……

Apache的配置文件httpd.conf关键的地方有没有搞错!我的配置是这样的:

#加载php模块
LoadModule php5_module D:/WebServer/php5/php5apache2_2.dllPHPIniDir "D:/WebServer/php5"

#运行php的后缀名可以是 .php或.html等
AddType application/x-httpd-php .php
还有检查一下目录的权限

……

估计是缓存的问题

Apache的配置文件httpd.conf关键的地方有没有搞错!我的配置是这样的:

#加载php模块
LoadModule php5_module D:/WebServer/php5/php5apache2_2.dllPHPIniDir "D:/WebServer/php5"

#运行php的后缀名可以是 .php或.html等
AddType application/x-http……

这个地方没问题,我检查了!谢谢!模块加载那个地方要是有问题apache服务器都运行不了!这个我检测过……

第二次 喜欢PHP,我的第一次回帖。

楼主能否把你的代码贴出来看下,这样猜测是很难解决问题的!

楼主能否把你的代码贴出来看下,这样猜测是很难解决问题的!

我拿过一个最简单的例子试验过
echo "12345!";
?>
用360浏览器页面能显示12345!,IE依旧下载对话框!

把IE9卸了,你都说了打开网上的网站都会让下载,那肯定是浏览器的问题了,跟环境设置一点关系没有。装个IE10吧!说不定问题就解决了

把IE9卸了,你都说了打开网上的网站都会让下载,那肯定是浏览器的问题了,跟环境设置一点关系没有。装个IE10吧!说不定问题就解决了

这个我赞同,我也觉得应该是浏览器的设置问题,至于IE10,观望中……

没解决啊? 我也遇到差不多的问题了,求解

解决了。。。。。
在最上面加上这句
header("Content-Type:text/html;   charset=utf-8");

解决了。。。。。
在最上面加上这句
header("Content-Type:text/html;   charset=utf-8");
是在php.ini文件加吗?


解决了。。。。。
在最上面加上这句
header("Content-Type:text/html;   charset=utf-8");
是在php.ini文件加吗?
在你代码文件中加



解决了。。。。。
在最上面加上这句
header("Content-Type:text/html;   charset=utf-8");
是在php.ini文件加吗?
在你代码文件中加

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
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP.Explain the concept of late static binding in PHP.Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

How to Register and Use Laravel Service ProvidersHow to Register and Use Laravel Service ProvidersMar 07, 2025 am 01:18 AM

Laravel's service container and service providers are fundamental to its architecture. This article explores service containers, details service provider creation, registration, and demonstrates practical usage with examples. We'll begin with an ove

Customizing/Extending Frameworks: How to add custom functionality.Customizing/Extending Frameworks: How to add custom functionality.Mar 28, 2025 pm 05:12 PM

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

See all articles

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!