Blog > php

PHP is a server side scripting language that is used to develop Static websites or Dynamic websites or Web applications. As the description says PHP scripts can only be interpreted on a server that has PHP installed. So in this entry we will define how to deploy your PHP applications on Amazon Web Services (AWS).

We will be using Amazon Lightsail to publish PHP applications on AWS. You can follow the steps below to create a new server with Amazon Lightsaill

Creating a server in AWS Lightsail
* Log into the AWS Mangement Console (if you don't have create one) and search Ligtsail service
* Click on the "Create Instance" button on the page that opens.
* A screen will appear for you to choose the server location and features. Select "Linux / Unix" as the server and "LAMP (PHP7)" as blueprint. Then click on the "Create Instance" button by adding the package amount, name and optionally additional key pairs and startup scripts.
* Your server will go live in a few minutes.
* After the server is activated, to get SSH connection key go over the bottom of the page and click "Account page" link.
With this SSH key set and the ip / user information given on the Lightsail screen, you can connect to your server with SSH, or you can send your files to the server with an FTP client such as Filezilla.
* You can reach your website using given ip address by any web browser

Sending PHP files to the server
* Create a new connection via Filezilla Site Manager using the IP and user information provided to us on the Lighsail screen. The point we need to pay attention here is that we should choose "Key file" as Logon Type and Server Type option should be "SFTP".
* After making the settings, we connect by clicking the "Connect" button.
* When sending the php files to "/opt/bitnami/apache/htdocs" directory on the server your server and php codes are ready to go!