扩展 PHP5 在 XAMPP 中不解析

Extension PHP5 does not parse in XAMPP(扩展 PHP5 在 XAMPP 中不解析)
本文介绍了扩展 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:xamppapacheconfextrahttpd-xampp 包含在配置中,并且在开头有这个:

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

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

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

AddType application/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 中不解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)