Cake php 4.5 x Aws Elastic Beanstalk

I am facing difficulties deploying a CakePHP application (version 4.5) on AWS Elastic Beanstalk. After performing the deployment (zipping the project’s files and folders and uploading them to AWS), the application shows an ‘OK’ status in Elastic Beanstalk. However, when accessing the generated link, I get the message ‘An Internal Server Error Occurred’ in the browser. The application works normally em development environment.

I have reviewed the full log files provided by Elastic Beanstalk but couldn’t find any specific information to help identify the cause of the error. I am also unsure which log file might contain the relevant details. Additionally, I’m uncertain whether the zip file I’m uploading includes all the required directories and files needed for the application to work correctly according to AWS and CakePHP standards.

I have already reviewed the deployment process and the project structure but still cannot pinpoint the issue. Could someone guide me on how to resolve this error or provide details about the essential directories and files that must be included in the zip package for a successful deployment on Elastic Beanstalk?

usually I’d do the following via SSH

rm -rf vendor
composer install

This re-install all composer rmodules. Just make sure that you have the same PHP version in your CLI (via php -v) as you run your webserver. No idea how you do that in AWS/Beanstalk

You should also be able to just look into the logs/error.log file which is present insinde your cakephp app to see more detailed error infos.

1 Like

also simply enabling debug mode in your config/app_local.php should lead you more detailed infos on what is going on.

1 Like