php 无法查看 XAMPP 本地主机页面,除了 Apache“It Works!”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3656044/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 10:34:51  来源:igfitidea点击:

Can't view XAMPP localhost Page except Apache "It Works!"

phpmysqlwindowsapachexampp

提问by JavaNoob

I am currently using Windows XP SP3 with Apache 2.2, PHP 5.3, MySQL 5.1 and XAMPP 1.7.3 installed.

我目前使用 Windows XP SP3,安装了 Apache 2.2、PHP 5.3、MySQL 5.1 和 XAMPP 1.7.3。

However after installing everything including XAMPP, I could not see the "XAMPP Welcome Page" at all! I only see the Apache default Page "It Works!!" on http://localhost/. I also tried http://127.0.0.1/but it gives back the same Apache results. My Apache and MySQL service seems to be running fine on the XAMPP console.

但是在安装了包括 XAMPP 在内的所有东西后,我根本看不到“XAMPP 欢迎页面”!我只看到 Apache 默认页面“It Works!!” 在http://localhost/ 上。我也尝试过http://127.0.0.1/但它返回相同的 Apache 结果。我的 Apache 和 MySQL 服务似乎在 XAMPP 控制台上运行良好。

I have also placed a php file under C:\program files\apache\htdocs\test.php and access the page via http://localhost/test.phpwhich works fine! I really can't guess why isn't the XAMPP installed over the Apache.

我还在 C:\program files\apache\htdocs\test.php 下放置了一个 php 文件,并通过http://localhost/test.php访问该页面,效果很好!我真的无法猜测为什么 XAMPP 没有安装在 Apache 上。

Can anyone please give some advice on the problem? Thanks.

任何人都可以就这个问题提出一些建议吗?谢谢。

回答by Félix Saparelli

XAMPP is a standalone AMP solution, so you don't need to install Apache or anything else with it. And if you do, both servers will probably conflict.

XAMPP 是一个独立的 AMP 解决方案,因此您无需安装 Apache 或其他任何东西。如果这样做,两台服务器可能会发生冲突。

You need to either uninstall XAMPP, or uninstall Apache, PHP, and MySQL.

您需要卸载 XAMPP,或者卸载 Apache、PHP 和 MySQL。

Note that XAMPP needs to be started up through its control panel, accessible from whatever start menu folder it will have created.

请注意,XAMPP 需要通过其控制面板启动,可从它将创建的任何开始菜单文件夹访问。

EDIT: Also, XAMPP has its own htdocs folder, located in C:\xampp\htdocs

编辑:另外,XAMPP 有自己的 htdocs 文件夹,位于 C:\xampp\htdocs

回答by Bruiser

Alternatively you can switch the port of the Apache server that came with your XAMPP installation via httpd.conf. and as it is described herefor example:

或者,您可以通过 httpd.conf 切换 XAMPP 安装附带的 Apache 服务器的端口。并且,因为它是描述在这里,例如:

Just remember to address the corresponding pages via http://localhost:XXXXXXXX being the new portnummer you picked (for example 8080).

只需记住通过http://localhost:XXXXXXXX 作为您选择的新端口号(例如 8080)来寻址相应的页面。

回答by M_ Fa

check the port from xampp control panel >config > Apache httpd.conf

从 xampp 控制面板 >config > Apache httpd.conf 检查端口

then enter image description here

然后 在此处输入图片说明