check the appspec file in github , use this doc for reference https://gbengaoni.com/blog/Deploy-a-PHP-application-on-EC2-with-Github-and-AWS-CodePipeline-fb38cf204cbb