0

I understand that this is a problem with many others and that this question has been asked before, but no matter what, nothing is working. In other situations, they get it eventually, but I've tried different versions of XAMPP and WAMP constantly and nothing works. Here's some things that I do know:

  • The documents I'm trying to run are in the "www" folder (WAMP) and "htdocs" folder (XAMPP). I'm using the default "test" pages that each program includes. This also means that they're not using the short PHP tags and they are PHP file types.

  • With WAMP, the icon turns green. I've had a problem in the past where it stayed yellow/orange, but I got it to go green. I also tried putting WAMP online, but that didn't make a difference.

  • Port 80 is not used. I changed Skype's settings to not use port 80. I also changed Apache's listening port to 81 temporarily, but no change.

  • Phpinfo() and localhost work on WAMP and XAMPP.

  • System Specs: Windows 7 64-Bit. (I've tried both 32-bit and 64-bit WAMP)

  • I tried it on my dad's laptop and that didn't work (Windows 7 32-bit). So it must not be something wrong with my computer?

  • Typing localhost/testmysql.php in the address bar shows this: I'm not sure what that means, but since a default file is named "testmysql.php" in the "www" folder, this is odd.

If you have any questions, just leave a comment. I'm sure that if this problem gets solved, then any situation that anyone else has can look here and find a solution. Thanks for your help in advance.

4

3 回答 3

0

我认为您无法双击 php 文件使其运行。安装服务器的目的是在服务器上运行文件。PHP 是服务器端的,永远不会作为本地文件正确运行。您必须从网址“localhost”开始,才能在服务器上运行该文件。

于 2013-09-17T17:34:56.830 回答
0

我用的是Visual-AMP,就像IIS一样,右键可以操作。

于 2013-09-06T10:24:46.510 回答
0

好吧,我不认为我能想出一个解决方案,但是这个“有点”行得通。事情是这样的:

我现在正在使用XAMPP,我创建了自己的 PHP 文件(带有<?php echo "It works!"; ?>)并将其放在“htdocs”文件夹中。当我双击该文件时,它会显示原始 PHP 代码。但是,如果我输入“ localhost/test.php ”,它就可以正常工作。

现在我不确定 WAMP 是否同样适用,因为我在找到解决方案之前卸载了它。我发现我必须在地址栏中输入文件的位置才能启动它有点令人沮丧,但是一旦我这样做了,其他页面的链接就可以正常工作。

我希望你们觉得这很有用,伙计们。如果您有一个解决方案允许在双击“htdocs”文件夹中的文件时运行 PHP,请继续,我不介意更改正确答案:)

于 2013-07-12T07:12:52.757 回答