0

I'm creating a site which I'm going to host on an Ubuntu Server. I have a user registration form on my site, which creates a user and a folder for that user (if filled out correctly). The form in handled by PHP and I'm running Apache 2 on the server. When I run the code on my laptop the folder is created, but when I run the same code on the server the folder is not there. I guess that it has something to do with permisssion. How can I tell apache that the code should have write permission in a specific folder called "users" located in /var/www/mysite/public/users/ ???

4

2 回答 2

1

尝试使用提供文件夹权限的 chmod 命令。就像是

chmod 777 -R foldername
于 2013-04-22T16:20:03.423 回答
0

如果安全不是问题,我建议:

chmod 775 -R /var/www/
chown -R [your_user]:www-data /var/www/

所以apache2(www-data)和你都可以编辑/var/www(或者/var/www/html,如果这是你的文件夹)里面的文件夹和文件。

请注意,这可能与 git 和其他捕获文件夹权限的工具有问题(例如,使用 git,您可能会使用 775 提交文件)。

于 2016-05-13T17:04:18.807 回答