简体   繁体   中英

AWS: Access S3 from Elastic beanstalk application

I have a PHP application which takes inputs from users and writes them to files using normal file operations like fopen, fwrite etc. It works well on my server. If I migrate this whole code to Amazon's Cloud and use it's services, how do I map these file operations to corresponding operations on Beanstalk?

Will the file operations work as they are, without change?
If yes, where will these files be store?
If no, what's the alternative?

Thanks for your help!!

You should consider looking into the S3 Stream Wrapper included with the official AWS SDK for PHP . Registering the stream wrapper allows you to work with the S3 using PHP's native file functions.

You can mount a S3 bucket as a partition and work with S3 files as they where located on your server's HDD.

I'm the lead developer and maintainer of Open source project RioFS project: an userspace filesystem to mount Amazon S3 buckets. You can use our project to mount and operate with files using PHP or any other programming language.

Hope it helps !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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