问题
I try to run my local applications on MAMP PRO. Since now i run MAMP and everything works fine. Now i've changed to MAMP PRO because of the possibilities to generate more hosts and send email from local applications.
Now i have the problem that i can't access files in a directory.
I have checked indexes under Hosts->Extended which should solve this problem.But it doesn't. I've found many articles but not anyone that solves my problem. I'm also not a specialist on server, but i think there must be a easy solution even in MAMP it works.
I've read something over Web-sharing but this was not clear described enough.
- MACOSX: 10.11.2
- MAMP PRO: 3.5
One failure in the log was:
"Permission denied: file permissions deny server access: /folder/file.js"
But where i can change it generally.
Thanks for your Help. I'm very confused.
codeFragment
回答1:
Sounds like a permission problem. Set the parent folder to "read only" for all and assign it to all folders/files below.
Greetings,
Peter
回答2:
This worked for me.
- Create an index file in the directory, by default Apache is looking for such a file
- If you want to access the directory (the list of your files or folders in the directory), just go in Mamp Pro to Hosts >> Advanced and check Indexes.
So simple, no need to go configure any file.
回答3:
This case is occur when you run Mamp with the Server Nginx and nginx server needed configuration of each working folder/directory. for the nginx configuration you can go in nginx.conf file on path
C:\MAMP\conf\nginx\nginx.conf
and write this script.
http {
.....
server {
location ~* /test(.*)$ {
root C:/MAMP/htdocs/test;
index index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9100;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
}
note: in this script test is my working directory. you can replace this name.
回答4:
Whenever you are setting up a new server on a Mac, whether it be MAMP, MAMP PRO or just straightforward Nginx/Apache, always set the right permissions on the root folder. Permissions are used for security reasons, not a bad thing in any way although it adds layers to get things done good or bad. Nginx/Apache usually uses _www to read and write on your folder. So you must grant _www access access.
To do this for example on a folder located at /MacHD/Sites
...
- open up a console
sudo chown -R _www Sites sudo chmod -R g+w Sites```
- restart your server
References: - https://ss64.com/osx/chmod.html - https://ss64.com/osx/chown.html
来源:https://stackoverflow.com/questions/34650562/403-forbidden-error-on-mamp