简体   繁体   English

无法更改使用PHP复制创建的文件的FTP权限

[英]Can not change permissions on FTP for files created with PHP copy

I have a script that uses the copy function of PHP to copy files to my server. 我有一个脚本,该脚本使用PHP的copy功能将文件复制到服务器。 When I log into my server via FTP I can't delete them anymore, as the permissions are set to 644. But when I try to change the permissions directly at the FTP, I get a "Operation not permitted" error. 当我通过FTP登录到服务器时,由于权限设置为644,因此无法再删除它们。但是,当我尝试直接在FTP上更改权限时,出现“不允许操作”错误。

NOOP
200 NOOP command successful
SITE CHMOD 777 /test2/2016-07-19/13739536_1750492681870132_416621053_n.jpg
550 CHMOD 777 /test2/2016-07-19/13739536_1750492681870132_416621053_n.jpg: Operation not permitted

Normally I can change the permissions on my server without any problems. 通常,我可以毫无问题地更改服务器上的权限。 Via SSH it is also not working. 通过SSH也不起作用。 Does it have to do something with the permissions of the original file? 它是否必须使用原始文件的权限来执行某些操作?

Thanks for your help! 谢谢你的帮助!

PHP script is a different user than the one that is logging in through FTP. PHP脚本与通过FTP登录的用户不同。

Either change the permisions of the file using another php script or log in as root through SSH. 使用另一个php脚本更改文件的权限,或通过SSH以root用户身份登录。

可能是提供的参数有误。通常应该可以正常工作

chmod("/test2/2016-07-19/13739536_1750492681870132_416621053_n.jpg",0777);

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

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