PHP 在 XAMPP 中不起作用

2022-01-14 00:00:00 xampp php

我在 Windows 的 XAMPP 1.7.7 中运行 PHP 时遇到问题.我已经在带有 IIS 的本地服务器中安装了 XAMPP(在 httpd.conf 以及其他配置中将端口更改为 81)到目前为止它可以工作,我可以连接到 xampp/index.php 但无法运行任何 .php我的 htdocs 中的文件(除了 html 部分显示为空白).它在我的本地工作(也安装了 IIS),但无法在服务器上工作.

I have a problem running PHP in XAMPP 1.7.7 for windows. I've installed XAMPP in a local server with IIS (changed the port to 81 in httpd.conf as well as other configuration) so far it works and I could connect to the xampp/index.php but coulnd't run any .php files in my htdocs (shows blank except for the html part). It works in my local (also have an IIS installed) but couldn't make it work in a server.

任何帮助将不胜感激.

推荐答案

如果我没看错你的问题,我想我在访问 XAMPP 中的 php 文件时遇到了同样的问题.我已经在网上搜索了几个小时,在论坛和谷歌上寻找答案,直到我找到了简单的解决方案.

If I got your question correctly, I think I had the same problem accessing a php file in XAMPP. I have been online for several hours searching forums and Google for the answer, not until I found the simple solution.

我将 PHP 文件作为 c 盘上的文件访问(例如 C:xamphtdocsdata.phpfile:///c:/xamp/htdocs/data.php)而不是作为网页(即//localhost/data.php).

I was accessing the PHP file as a file on c drive (eg. C:xamphtdocsdata.php or file:///c:/xamp/htdocs/data.php) instead of as a webpage (ie //localhost/data.php).

我希望这对你也有帮助.

I hope this will be helpful to you as well.

相关文章