无法查看本地主机中的文件夹目录 [英] Unable to see folder directory in localhost

查看:49
本文介绍了无法查看本地主机中的文件夹目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让网站在Mac上本地运行.

I am trying to get a website to run locally on my Mac.

我已经安装了MAMP,并且Apache和MySQL服务器都在运行.我已经测试了MAMP,并收到了最初的欢迎"消息,他们告诉您一切都很好,并从MAMAP/htdocs中删除了默认的index.php文件.

I have installed MAMP and both Apache and MySQL Servers are running. I have tested MAMP and got the initial "Welcome" message where they tell you all is fine and to delete the default index.php file from MAMAP/htdocs.

我删除了此文件,并在MAMP/htdocs中创建了一个名为Hello的测试文件夹和一个名为Want的网站文件夹.

I delete this file and in MAMP/htdocs I create a test folder called Hello and the folder for the website called Want.

我试图在本地运行的网站是现有网站,并且我可以通过FTP访问该代码.我已将旺旺"的所有文件和文件夹下载到我的桌​​面上.现在,我将所有的Wants内容都放在MAMP/htdocs/Want中.

The website I am trying to run locally is an existing website and I have FTP access to the code. I have downloaded all the files and folders for Want to my desktop. I now put all Wants content in MAMP/htdocs/Want.

在浏览器中,我转到本地主机,然后可以看到在其中创建的2个文件夹:Want和Hello,请参见屏幕抓取.

In the browser I go to localhost and I can see my 2 folders I created in there: Want and Hello see screen grab.

如果单击旺旺"文件夹,则浏览器将超时.我看不到其中包含所有旺旺文件和文件夹的子目录.

If I click on the Want folder, the browser just times out. I don't see a sub directory with all of Want's files and folders in it.

要测试其功能,我创建了一个hello.php文件并将其放在Hello文件夹中.在本地主机中,我选择"Hello",然后可以在其中看到我的hello.php文件,然后单击它就回显了hello-如预期的那样.

To test its working I create a hello.php file and place it in Hello folder. In localhost I select Hello and can see my hello.php file in there and clicking on it just echoes back hello - as was intended.

然后我从Want文件夹中删除所有内容,并将hello.php复制到Want文件夹中.这可以完美地工作,我可以看到hello.php并单击它回显Hello.

I then remove all content from Want folder and copy hello.php into the Want folder. This works perfectly and I can see the hello.php and clicking on it echoes Hello back.

但是,当我将旺旺的内容复制回旺旺文件夹时,当我单击旺旺文件夹查看子目录时,浏览器只是再次超时.

But when I copy back the content of Want back into the Want folder, the browser just times out again when I click on the Want folder to view the sub directories.

我也尝试过将index.php从原始的Want文件夹复制到我的Want文件夹中,但浏览器仍然超时.

I have also tried just copying index.php from the original Want folder into my Want folder but still the browser just times out.

有人知道这是什么原因吗?

Does anyone have any idea what can be causing this?

推荐答案

遇到了同样的问题.我设法做的是删除 .htaccess 并再次写入.问题是我在>"之一之间有一个空格.

Just had the same problem. What I managed to do was to delete .htaccess and to write it once again. The problem was that I had a SPACE between one of the ">".

这篇关于无法查看本地主机中的文件夹目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆