问题
I am trying to get a website to run locally on my Mac.
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.
I delete this file and in MAMP/htdocs I create a test folder called Hello and the folder for the website called 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.
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.
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.
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.
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?
回答1:
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 ">".
来源:https://stackoverflow.com/questions/21713821/unable-to-see-folder-directory-in-localhost