Innovate faster and cut risk with PHP experts from Zend Services.
Beginning to advanced PHP classes to learn and earn global certification.
Help me choose >
Submit support requests and browse self-service resources.
Earlier this month we hosted an AWS 101 webinar in which we did a live walk-through showing you how easy it is to get up and running with your PHP applications on the enterprise cloud platform AWS.
In this article, we'll walk you through getting started with AWS using a Zend PHP server. But first, let's clear up a common question.
Yes, there are many options for deploying PHP applications on AWS. These options ranging from using a minimal OS image to spin up an instance and then install LAMP stack on top of it, or use images that come with everything needed to run web application pre-installed.
One of the quickest ways to get your PHP app into an AWS machine is to use Zend Server AWS machine images (AMI) which comes with Zend Server pre-installed (but without MySQL server). If your application requires a MySQL server (and many PHP apps do), we recommend using AWS RDS which supplies MySQL as a service.
Aside from regular PHP and Apache stack, Zend Server also provides additional value with the following components:
Zend Server images on AWS Marketplace provide a choice of the following options:
Ready to get started with AWS PHP + MySQL?
As a follow-on to the webinar, we have pulled together this step-by-step guide covering how to start a simple instance of Zend Server on AWS, add RDS MySQL service and connect to it, and launch WordPress using Zend Server deployment.
Let’s start with a simple vocabulary of common terms that are used when discussing AWS:
To help you understand the different AWS security settings, these security terms will become handy:
There are two ways to launch Zend Server on AWS. First is to use AWS Marketplace website (option A) and launch Zend Server from there. Second is to use Marketplace inside AWS Console (option B). We will cover both ways here.
Once you have finished either option A or B, you need to make Zend Server ready for work. We have to bootstrap it using very simple wizard. To do this we open the Zend Server UI which is accessible using a web browser on port 10081 of the instance we just started.
We need to find out either the public DNS (what we use in this guide) or public IP of the instance. We will also need the instance ID to enter Zend Server UI. By default Zend Server UI is protected so you have to enter instance ID as login and password, but once you bootstrap Zend Server and set admin password you won’t have to use it again.
Follow these steps to find “Public DNS” and “Instance ID” of your instance:
Now that we have public DNS name of instance we can open our browser and enter the following address to access Zend Server UI: http://<Public DNS>:10081/
Once you open Zend Server UI you will first be asked to authenticate. Enter “Instance ID” you found earlier as both login and password.
You will then be presented a wizard that will guide you to setup Zend Server in a few very simple steps. Upon finishing wizard and successfully bootstrapping your Zend Server is fully ready to work.
Note: bootstrap process can be fully automated by providing user data to instance.
We have Zend Server, which means that we have fully working and configured web server with PHP. To go on and launch WordPress, we are still need to add a MySQL database server. We, of course, could install and configure it on the same instance with Zend Server, but it’s much simpler to use AWS RDS. RDS provides many database services including MySQL. So let’s setup an RDS instance and configure Security Group to allow access to it:
Now we have to wait till our new DB instance is launched and ready for use. While waiting we can configure our Security Group rules to allow communication between web server and MySQL DB server.
There are two options for configuration here: either allow communication only between web server and MySQL server (more suitable for production environments), or allow anyone to connect to MySQL DB server (more suitable for development environments). In this guide we will cover only second option.
To find MySQL server DNS see how to find endpoint (which is also MySQL DNS) in next step.
Once RDS has finished starting (it can take 10 minutes or even more), you have to find its endpoint. For this follow these steps:
Once we have MySQL endpoint we can deploy the WordPress application. For this do the following:
Once you click “Deploy” application deployment will be started. It should take up to a few minutes to finish (but most of time it finishes in tens of seconds). Once the application status on applications list page changes to “Deployed”, you can access WordPress on http://<Instance Public IP>/
Most interesting and impressive feature of Zend Server for developers is Z-Ray. It can show comprehensive information about how page was generated by PHP, what resources were used, timing of any function, and even more custom and specific information using plugins. Since we already deployed WordPress on our Zend Server, let’s see what Z-Ray can show us. Z-Ray is displayed as a bar at bottom of web page in browser (this bar is injected by Z-Ray PHP extension in Zend Server). So open your WordPress website and you will see a bar on bottom similar to this:
Note that Z-Ray is enabled by default only in Zend Server Developer Edition, or when you choose “Development” profile during bootstrap process of Zend Server Professional Edition and Zend Server Enterprise Edition. Additionally you can configure Z-Ray to be shown only for requests coming from specific IP addresses or when URL has Z-Ray token. This is very useful if you want to use Z-Ray in production, but do not want to show it to anyone visiting your website.
You can start using Zend Server on AWS today. You can also start a free 30-day trial.
START FREE TRIAL