简体   繁体   English

Python删除功能在Apache中不起作用

[英]python delete function not working in apache

I am using the s3cmd linux utility to delete files from our amazon s3 bucket. 我正在使用s3cmd linux实用程序从我们的Amazon s3存储桶中删除文件。 I have created a function in python which calls the s3cmd command line utility and access and deletes the files amazon s3 bucket. 我在python中创建了一个函数,该函数调用s3cmd命令行实用程序并访问并删除文件亚马逊s3存储桶。

command= 's3cmd -c .s3cfg del s3://project-bucket/images/testimage.jpg'
os.system(command)

When I run the project through django development server, it works fine. 当我通过Django开发服务器运行该项目时,它运行良好。 The image is deleted. 图像被删除。

But if I run on apache it does not work. 但是,如果我使用apache不能运行。 The image is not deleted. 图像不会被删除。 I checked the apache error logs, they are no errors in the apache log. 我检查了apache错误日志,它们在apache日志中没有错误。 Please help. 请帮忙。

确保apache用户具有写入所有要删除的图像和文件夹的权限。

the issue is resolved. 问题已解决。 gave 777 permissions to the .s3cfg file and now i am able to list the image as well as delete the image. 授予.s3cfg文件777权限,现在我可以列出该图像以及删除该图像。

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

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