netbeans php插件使用FTP上传文件时如何控制文件权限
每当 netbeans 执行 ftp 上传时,文件都会以设置为 640 的权限上传。这会导致 PHP 抛出以下错误:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required '/Library/WebServer/Documents/notes/index.php' (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0
虽然我可以使用快速 chmod o+r ./*
来清理它命令提示符会导致 netbeans 在我下次点击运行时重新同步整个项目,从而将权限设置回 640。
我需要一种方法让 netbeans 上传权限设置为 644 的文件。
Whenever netbeans preforms an ftp upload the files are uploaded with the permissions set to 640. This causes PHP to throw the following error:
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required '/Library/WebServer/Documents/notes/index.php' (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0
While I can clean it up with a quick chmod o+r ./*
in the command prompt it causes netbeans to resynchronize the entire project next time I hit run which in turn sets the permissions back to 640.
I need a way to make netbeans upload the files with permissions set to 644.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
确保在“项目属性”>“保留远程文件权限”下选中“保留远程文件权限”复选框。 如果您不想更改远程文件权限,请选中运行配置。
Make sure the checkbox for "Preserve Remote File Permissions" under Project Properties > Run Configuration is checked, if you want to not change remote file permissions.
我确定问题不在于 netbeans。 它是在服务器上使用
ftpd
实现的。修复方法是在
/etc/
中创建一个名为ftpd.conf
的文件,并添加以下行:I determined that the problem was not with netbeans. It was with
ftpd
on the server.The fix was to create a file called
ftpd.conf
in/etc/
and add the following line:在您的 vsftp.conf 文件中,查找以下内容:
然后,根据需要取消注释/调整。
In your vsftp.conf file, look for this:
Then, un-comment / adjust as needed.
如果你像我一样累的话,只是为了让你轻松一点。 所有其他答案都是一个兔子洞,对我不起作用。
Just to make a little easier if you are tired like I was. All the other answer where a rabbit hole and didn't work for me.