简体   繁体   English

ubuntu服务器,php,ftp权限

[英]ubuntu server, php, ftp permissions

Ubuntu Server 14.04.1 w/ LAMP and Webmin/proFTP (haven't really used webmin much; too much stuff flying around) 带有LAMP和Webmin / proFTP的Ubuntu Server 14.04.1(并没有真正使用过Webmin;太多的东西飞来飞去)

Issue: With my user as owner of /var/www/ I can ftp files to the server, but PHP cannot handle files without www-data as the owner. 问题:以我的用户作为/ var / www /的所有者,我可以将文件ftp到服务器,但是PHP如果没有www-data作为所有者,则无法处理文件。

I also tried: sudo adduser myUsername www-data sudo chown -R www-data:www-data /var/www/ 我也尝试过: sudo adduser myUsername www-data sudo chown -R www-data:www-data /var/www/

This still did not allow my user to FTP upload to this directory; 这仍然不允许我的用户通过FTP上传到该目录; changing it back to sudo chown -R myUsername:myUsername /var/www/ allows for FTP again. 将其更改回sudo chown -R myUsername:myUsername /var/www/允许再次使用FTP。

How can I setup permissions to able to use FTP and have PHP be able to handle files (cURL, fopen, exec, etc.)? 如何设置权限以使用FTP并让PHP能够处理文件(cURL,fopen,exec等)?

I don't think this is the correct site to ask this question. 我认为这不是问这个问题的正确网站。

However try: 但是尝试:

usermod -a -G www-data yourUserName

文件夹权限设置为755,并且应该已经为775(为组写)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM