I am experimenting with using AWS. To be specific, I am following the tutorial at this link:
I have tried to add empty PHP tags to the start of the file and renamed the file to index.php instead of the index.HTML of the tutorial. I did a full sequence of refreshing the web app resources and deploying the app on the Amplify console. It did not work. I tried only using the HTML code on index.php and it still did not work. I put back the PHP code, added an echo statement echo "<h1>PHP Code Ran</h1>";
but renamed the file to index.html and it did render. Granted, there was an error in the text output. It also wrote the ending semi-colon and ending quotation, but it worked.
Is there any way for me to use a file named index.php as the home page of a web app using AWS amplify?
My Answer:
Unfortunately, AWS Amplify does not support PHP files for hosting static websites. AWS Amplify is designed to host static websites and does not support server-side scripting languages like PHP. If you need to use PHP for your web application, you may need to consider using a different hosting service that supports PHP, such as AWS Elastic Beanstalk or AWS EC2.
Rate this post
4 of 5 based on 8254 votesComments