Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I mount an S3 bucket to an EC2 instance and write to it with PHP?
    primarykey
    data
    text
    <p>I'm working on a project that is being hosted on Amazon Web Services. The server setup consists of two EC2 instances, one Elastic Load Balancer and an extra Elastic Block Store on which the web application resides. The project is <em>supposed</em> to use S3 for storage of files that users upload. For the sake of this question, I'll call the S3 bucket <code>static.example.com</code></p> <p>I have tried using <code>s3fs</code> (<a href="https://code.google.com/p/s3fs/wiki/FuseOverAmazon">https://code.google.com/p/s3fs/wiki/FuseOverAmazon</a>), <code>RioFS</code> (<a href="https://github.com/skoobe/riofs">https://github.com/skoobe/riofs</a>) and <code>s3ql</code> (<a href="https://code.google.com/p/s3ql/">https://code.google.com/p/s3ql/</a>). <code>s3fs</code> will mount the filesystem but won't let me write to the bucket (I asked this question on SO: How can I mount an S3 volume with proper permissions using FUSE). <code>RioFS</code> will mount the filesystem and will let me write to the bucket from the shell, but files that are saved using PHP don't appear in the bucket (I opened an issue with the project on GitHub). <code>s3ql</code> will mount the bucket, but none of the files that are already in the bucket appear in the filesystem.</p> <p>These are the mount commands I used:</p> <pre><code>s3fs static.example.com -ouse_cache=/tmp,allow_other /mnt/static.example.com riofs -o allow_other http://s3.amazonaws.com static.example.com /mnt/static.example.com s3ql mount.s3ql s3://static.example.com /mnt/static.example.com </code></pre> <p>I've also tried using this S3 class: <a href="https://github.com/tpyo/amazon-s3-php-class/">https://github.com/tpyo/amazon-s3-php-class/</a> and this FuelPHP specific S3 package: <a href="https://github.com/tomschlick/fuel-s3">https://github.com/tomschlick/fuel-s3</a>. I was able to get the FuelPHP package to list the available buckets and files, but saving files to the bucket failed (but did not error).</p> <p>Have you ever mounted an S3 bucket on a local linux filesystem and used PHP to write a file to the bucket successfully? What tool(s) did you use? If you used one of the above mentioned tools, what version did you use?</p> <p><strong>EDIT</strong> I have been informed that the issue I opened with <code>RioFS</code> on GitHub has been resolved. Although I decided to use the <a href="http://docs.aws.amazon.com/AmazonS3/latest/API/APIRest.html">S3 REST API</a> rather than attempting to mount a bucket as a volume, it seems that <code>RioFS</code> may be a viable option these days.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload