That's cool. If you can please tell us how to connect database and change url to standard url and the automatic deployment using github.that would be great. Thank you very much
I have got my serverless laravel api to work with non-secured route. However, with secured route with authorization token, it doesn't work. It seem that on lambda, it cannot read my FILE_CACERT= ../php/cacert.pem in .env file. I place the cacert.pem in php folder in the roote directory. Please advise what it could be wrong.
Hi, we followed the same configuration for deploying laravel project to aws lambda. now we are getting the following error. Error communicating with PHP-FPM to read the HTTP response. A root cause of this can be that the Lambda (or PHP) timed out, for example when trying to connect to a remote API or database, if this happens continuously check for those! Original exception message Do u have any idea to resolve this?
.env will not be created in lambda, you will have to create this file and then add the credentials before deploying on lambda. If you already have this file then check your RDS credentials. Try connecting to RDS using a mysql client to see if you are able to connect. Also check if you are using correct AWS region in .env file.
getting error message when I try to run "composer require bref/bref bref/laravel-bridge" it stated that "Package bref/laravel-bridge at version has a PHP requirement incompatible with your PHP version (7.2.24)" any idea?
Great video. However, I have encountered an error "There is no existing directory at "/var/task/storage/logs" and it could not be created: Read-only file system". I cann't fix the issue even though I set APP_LOG=errorlog in .env file. Please advice what I may have missed.
@@CSCode Here are the changes that I have made to .env file. CACHE_DRIVER=array SESSION_DRIVER=cookie VIEW_COMPILED_PATH=/tmp/storage/framework/views LOG_CHANNEL=stderr Please note that I have any specific requirement to use APP_LOG=errorlog. But it's due the error that is the same as medium.com/artisanhost/hosting-a-laravel-application-on-aws-lamdba-90b7133c8578 Please advise.
@@phyromphat the issue doesn't seem to be due to php version but is related to configuration. In this video, we are writing log to cloudwatch. So if you are getting this error then it looks like maybe somewhere configuration is incorrect. One more thing is that the error that you shared says that directory cannot be created, So please make sure that the log directory is part of your project but has a .gitignore file so that it's content are not being tracked in git.
@@CSCode I have managed to resolve it with additional lines of codes in bootstrap\app.php $directoryNames = ['/tmp/laravel/framework/sessions', '/tmp/laravel/framework/cache', '/tmp/laravel/framework/views']; foreach ($directoryNames as $directoryName) { if (!is_dir($directoryName)) { mkdir($directoryName, 0755, true); } } $app->useStoragePath( '/tmp/laravel' );
I got a similar error during queue setup with serverless laravel. Mine was due to caching issue. You can check this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qThgfivpmd0.html. If you are getting the exact error then try the steps in that video.
@@CSCode I resolved that issue, but now I'm getting another error I followed all the steps and now I'm trying to access my API with the link generated, it's a simple post API to get a list which works when hosted in the local environment. It gives me the error of missing authentication token when no auth token was set by me
If I add AWS signature in the Authorization then it gives me signature we calculated does not match signature provides ,check AWS secret key and signing method , I checked the key it's correct but I've not set up any signature as I followed your tutorial the API gets hosted directly after the lambda function is created