I wanna host a php file that retrieve data from a mysql DB how ever aws is not authorizing POST method.
I need to know how can I add the code in PHP knowing I already configured the Bucket policy and CORS
You can only serve static content from an S3 - PHP will not be processed.
If you want to set up a dynamic PHP website on AWS have a look at LightSail and its LAMP stack.
You should try Amazon API Gateway.
Related
I have a database (MySQL) created in Amazon RDS. Also created a PHP class for connecting to that database and which will return some webservice as JSON format according to the request. Which I am using for my mobile and Angular applications.
Currently I am hosting that php file in one of my GoDaddy server and calling that PHP file from the app(s).
My question is - can I use AWS Lambda for this purpose (for deploying php file ) ? In some tutorials I found Lambda will not support PHP.
The PHP file serves the following functionalities
Creating various JSON files from MySQL table.
Uploading images to Amazon S3 bucket.
Sending push notifications (FCM) to Android / iOS devices.
AWS Lambda currently does not support PHP.
You could use any one of the supported languages for your purpose.
For push notifications you could use SNS
Read more: https://aws.amazon.com/lambda/faqs/
Can we upload image files to a GCP running compute engine directly using PHP?
I know that it can be done using the backend ssh on GCP.
I have a solution that works in my local system to upload files but does not work on GCP.
Based on initial research it appears that GCP does not allow file upload directly.
Need confirmation though or if there is a way in which file upload can work, please enlighten.
I do not think it can be done directly through php, through ssh yes.
You can upload files with PHP.
If you want to upload to the server local disk, things become a bit simpler. Just ensure you have PHP configured for upload: PHP File Upload
If you want to upload to Google Storage, say to a bucket, you'd need to authenticate and get access there. Google Cloud SDK can provide this. Then you can install API Client Libraries for PHP and optional Cloud SDK components. That way you might call gcloud shell command or use API. Cloud SDK will provide transparent connection and authentication for you so that you can upload to the Google Storage.
Please see:
Cloud SDK
Google API Client Libraries
I need to send an image to aws using an API in PHP. The image comes from the webcam, I have set up the aws as well, the backend neural network on aws is in python. I need to directly take the image I get from the webcam and send it to the backend and the neural network should start processing the image. How do I write an API call to the backend? And how do I start the backend code in one swift flow, without having to run the backend separately?
in aws beckend which aws you are using please speify your so other can understand and suggest you path as per it.
you can do one thing upload image to s3 and trigger lambda if image uploaded to s3 using lambda you can trigger other services. if you are using lambda as beckend service then it will easy
https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
.
I have developed an Android app which does a GET/PUT operations with a test web server for fetching and storing data in JSON format. For PUT using a PHP script on webserver via parameters in url. Now to scale the solution, i am exploring AWS solutions. How to achieve PHP script based logic handling on webserver with AWS S3 or any other cloud based storage which can perform this php based logic handling.
I would recommend to use AWS Lambda- It doesn't need servers to be hosted and maintained, which is a big headache. With AWS Lambda, in few minutes you can get your web application running. Your PHP scripts can be hosted as service and AWS will take care of its scalability and availability.
https://www.youtube.com/watch?v=eOBq__h4OJ4
https://aws.amazon.com/serverless/build-a-web-app/
https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/
AWS S3 you can use for storing your static files like images, css, javascript etc...
I'm working on a PHP application hosted on Google App Engine which requires access to objects stored in an S3 Bucket. I've looked at the APIs available for Amazon S3 and all of them make use of CURL. But CURL is not allowed in Google App Engine.
Is there a way to access Bucket Contents and user other functions available in the S3 API without using CURL in PHP?
Amazon recently released a wrapper for file_get_contents which is what urlfetch uses - so take a look at http://blogs.aws.amazon.com/php/blog/tag/stream - looks like you can do $contents = file_get_contents("s3://{$bucket}/{$key}");
You should look at the URL Fetch docs - it's the google recommended way to do calls https://developers.google.com/appengine/docs/php/urlfetch/
Use the URL Fetch API instead of CURL
https://developers.google.com/appengine/docs/php/urlfetch/