开发者

How do i run s3cmd from PHP?

How do i run s3cmd from PHP. What i am trying to do is backup certain files on s3 and will be storing its public url in database. $result = shell_exec("s3cmd put --skip-existing --acl-public /var/www/RD/temp.txt s3://xxxx/xxx/xx/");

However when i run the .php file .. nothing happens..

I have gone through the link mentioned below, but it didnt work for me. https://serverfault.com/questions/91443/why-shell-command-runs-from-command-line-but-not-开发者_StackOverflowfrom-php-script

Abhishek Jain


This failed for me with no error until I used the full path:

exec('/usr/local/bin/s3cmd --access-key=ZZZZZ --secret-key=XXXXX put /Users/me/filename.jpg s3://bucketname/foldername/'); 


Why not instead use a proper PHP S3 library? Take a look at http://code.google.com/p/amazon-s3-php-class/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜