扩展 PHP5 不在 XAMPP 中解析 [英] Extension PHP5 does not parse in XAMPP

查看:26
本文介绍了扩展 PHP5 不在 XAMPP 中解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 XAMPP Apache 服务器并将我的网站放入 htdocs.我已经启动了 Apache 服务器.在我的网站上,我有扩展名为 PHP 和扩展名为 PHP5 的文件.不同之处在于,当我在浏览器中输入 localhost/file.php 时 - 我看到了一个已解析的网站.

I've installed XAMPP Apache server and put my website into htdocs. I've started Apache server. On my website I've got files with extension PHP and with extension PHP5.The difference is that when I type in into browser localhost/file.php - I see a parsed website.

但是当我输入 localhost/file.php5(我在服务器上有这个文件)时,浏览器会问我是否要下载或打开这个文件.如果我选择打开,我会看到 file.php5 的 PHP 代码!

But when I type localhost/file.php5 (i have this file on server), than browser asks me if I want to download or open this file. And if I choose open than I see PHP code of file.php5!

我已经研究了配置,所以:

I've looked into configuration, so:

  1. 我没有 htaccess 文件
  2. PHPINFO() 显示 PHP 5
  3. c:\xampp\apache\conf\extra\httpd-xampp 包含在配置中,并在开头有这个:

  1. I dont have htaccess file
  2. PHPINFO() shows PHP 5
  3. c:\xampp\apache\conf\extra\httpd-xampp is included into configuration and has this on the beginning:

AddType 应用程序/x-httpd-php-source .phps

AddType application/x-httpd-php-source .phps

AddType 应用程序/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt

AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt

我也试过:

AddHandler php5-script .php5
AddType text/html .php5

进入httpd.conf,但它对我不起作用(没有变化).

Into httpd.conf, but it does not work for me (no changes).

你能帮我修一下吗?我想用php5解析器打开php5和php扩展文件.

Could you please help me fixing it? I would like to have php5 and php extension files to be opened with php5 parser.

推荐答案

XAMPP 默认将具有以下扩展名的文件传递给 PHP: .php .php5 .php4 .php3 .phtml .phpt (this已使用 XAMPP Lite 1.6.8 进行测试).

XAMPP passes by default files with the following extensions to PHP: .php .php5 .php4 .php3 .phtml .phpt (this was tested with XAMPP Lite 1.6.8).

我的建议是从 XAMPP 配置中删除AddType text/html .php5"行.或者,使用全新安装的 XAMPP 并查看差异(例如 WinMerge).

My suggestion would be to remove the "AddType text/html .php5" line from the XAMPP configuration. Alternatively, use a clean install of XAMPP and look at the differences (with something like WinMerge).

这篇关于扩展 PHP5 不在 XAMPP 中解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆