Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows7Pro上的PHP5.4.11/Apache2.4.2。php文件仅在DocumentRoot中运行_Php - Fatal编程技术网

Windows7Pro上的PHP5.4.11/Apache2.4.2。php文件仅在DocumentRoot中运行

Windows7Pro上的PHP5.4.11/Apache2.4.2。php文件仅在DocumentRoot中运行,php,Php,我刚开始做一些事情,所以请容忍我。我决定自学。安装并运行Apache 2.4.2正常。已安装PHP5.4.11正常。在Apaches httpd.conf中,我将documentroot路径从Apache默认值更改为“C:\Web”,该文件夹中有一个名为testsite的文件夹。。问题是:然后我创建了一个名为info.php的文件来测试php是否正常运行 http://localhost/index.html运行正常 http://localhost/testsite/index.html运行

我刚开始做一些事情,所以请容忍我。我决定自学。安装并运行Apache 2.4.2正常。已安装PHP5.4.11正常。在Apaches httpd.conf中,我将documentroot路径从Apache默认值更改为“C:\Web”,该文件夹中有一个名为testsite的文件夹。。问题是:然后我创建了一个名为info.php的文件来测试php是否正常运行

  • http://localhost/index.html
    运行正常
  • http://localhost/testsite/index.htm
    l运行正常
  • http://localhost/info.php
    运行正常
  • http://localhost/testsite/info.php
    不运行

关于同一个php文件为什么不在我的子文件夹中运行的任何帮助都将非常有用。

请检查您的子目录的文件权限。这是最常见的原因。您需要验证是否更改了httpd.conf中的“DocumentRoot”和相应的“”条目。您还需要验证您没有重写.htaccess中的处理程序。正如@AmalMurali提到的,您还应该检查您的文件/目录权限。