PHP AWS HTTP Error: Cannot be opened using r + fopen mode

I transferred my PHP server files from windows to ubuntu 14.04, and my script crashed ... I get an error message when booting from S3.

        $result = $s3->getObject(array(
            'Bucket' => AWS_S3_BUCKET,
            'Key'    => $imgName,
            'SaveAs' => $targetPath
        )); //the exception is thrown!

Exception Message:

GetObject runtime error at http://s3.amazonaws.com/bucket/file AWS HTTP error: cannot open .. /../downloads/file using r + mode: Eorep (../../downloads / file) .

sudo chmod -R 777 wwwfolder didn't work

Any ideas?

** Update **

Hax Found / Workaround .... adding touch ($ targetPath) to $ s3-> getObject method fixes the problem ... but why ? I tried on another ubuntu server (the same version) and it works there (without touch, and I don't know how it was configured ..). Now what? Any ideas?

+4
1

1 !

+1

Source: https://habr.com/ru/post/1607331/


All Articles