Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Cees-Jan Kiewiet:
Deploying Sculpin to S3 with CircleCI
Jun 16, 2016 @ 11:56:12

Cees-Jan Kiewiet has written up a post showing how he combines S3 and CircleCI to deploy a Sculpin site for his blog. Sculpin is a popular PHP-based static site generator.

Until 10 minutes before the start of this month I had a VPS at Digital Ocean running with Jenkins and Gitolite on it for privately hosted repositories. With Github's recent move to unlimited repositories I really didn't have a need to host them myself anymore, and after playing with CircleCI's free tier it didn't make any sense anymore to keep that VPS up.

Since porting git over to another remote is as more Github's domain we're focusing on deploying Sculpin to S3 using CircleCI in this post.

He starts by outlining some of the prerequisites to get in place before trying to set up the process on your own application. He shows you how to set up an IAM user for the S3 bucket and configure CircleCI though a simple YAML file. He also mentions the set up for tests, loading in other dependencies needed (Composer) and finally the deployment that executes Sculpin's "generate" command to build the site.

tagged: sculpin circleci s3 aws deployment tutorial configuration setup

Link: https://blog.wyrihaximus.net/2016/06/deploying-sculpin-to-s3-with-circleci/

Chris White:
Avoiding the burden of file uploads
Jun 14, 2016 @ 09:18:59

Chris White has a post to his site sharing a method he's come up with to avoid the burden of file uploads in your PHP application with the help of the offerings of Amazon S3 and some creative coding.

Handling file uploads sucks. Code-wise it's a fairly simple task, the files get sent along with a POST request and are available server-side in the $_FILES super global. Your framework of choice may even have a convenient way of dealing with these files, probably based on Symfony's UploadedFile class. Unfortunately it's not that simple.

[...] For most situations using S3 is a no brainer, but the majority of developers transfer their user's uploads to S3 after they have received them on the server side. This doesn't have to be the case, your user's web browser can send the file directly to an S3 bucket. You don't even have to open the bucket up to the public. Signed upload URLs with an expiry will allow temporary access to upload a single object.

He points out two advantages of this method: that you don't have to handle the upload part of file uploads and that it gives the user more control. He shares a video of the end result (a simple file upload frontend) and the code that you'll need to use the AWS PHP SDK to make it all work together. There's some configuration changes that'll need to be made on the S3 bucket side (like for CORS) but the code itself to make the connection is relatively simple. He does a great job of explaining every step of the way and includes the Javascript needed for the frontend as well.

tagged: file upload amazon s3 aws tutorial frontend

Link: https://cwhite.me/avoiding-the-burden-of-file-uploads/

Liip Blog:
Testing in the Cloud – Using Bamboo with Amazon AWS
Jun 08, 2016 @ 14:51:19

On the Liip blog there's a new post showing you how to set up "testing in the cloud" with the help of AWS and a Bamboo instance along with some custom configuration.

Bamboo is the continous integration service by Atlassian, the company owning the code management service Bitbucket (as well as the Jira issue tracker and Confluence wiki). Bamboo can run test suites and build any kind of artefact like generated documentation or installable packages. It integrates with Amazon Web Services, allowing to spin up EC2 instances as needed.

The article talks about the permissioning needed for the EC2 AWS instances and how to trigger automatic builds. They then get into the details of configuring the test runner and the PHPUnit setup to allow for the execution of your tests.

tagged: testing cloud aws bamboo amazon ec2 instance atlassian

Link: https://blog.liip.ch/archive/2016/06/08/testing-cloud-using-bamboo-with-amazon-aws.html

That Podcast:
Episode 28: Work, Work, Work
Mar 31, 2016 @ 09:41:57

That Podcast, hosted by PHP community members Beau Simensen and Dave Marshall, has posted its latest episode - Episode #38: [Work, Work, Work].

Beau and Dave talk about some of their recent work efforts, Dave's first look at DynamoDB, other AWS services, migrating event streams, email integration with Context.io and the challenges of maintaining privacy with such systems.

Amazon Web Services topics include DynamoDB, SES and Lambda. Also mentioned are Monii and Context.io. You can listen to this latest episode either through the in-page audio player or by downloading the mp3. If you enjoy the show be sure to also subscribe to their feed and get information on the latest shows as they're released.

tagged: thatpodcast ep28 work monii contextio aws podcast beausimensen davemarshall

Link: https://thatpodcast.io/episodes/episode-28-work-work-work

SitePoint PHP Blog:
Running an Elastic LAMP Stack on AWS
Mar 15, 2016 @ 11:54:38

The SitePoint PHP blog has posted a tutorial from Daniel Berman giving you a step by step guide to setting up an Elastic LAMP stack on AWS, the Amazon Web Services platform using Zend Server.

This article introduces what is probably one of the simplest ways of setting up and running an elastic LAMP stack on the cloud – using Zend Server on AWS.

More specifically, the workflow described here includes launching a pre-configured AWS CloudFormation template that sets up all the components of a LAMP stack: Zend Server’s certified PHP stack plus all of Zend Server’s add-on features (including Z-Ray), a MySQL database, a Zend Server elastic group consisting of additional Zend Server instances, an elastic load balancer, and other pre-configured security definitions. This article is perfect for those contemplating moving their production environment to the cloud or those who already have one set up on AWS.

He starts with some of the basics: what Zend Server is and what role CloudFormation plays in the deployment process. The rest of the tutorial is broken up into several steps of the setup and deployment process:

  • Step 1: Launching the stack
  • Step 2: Managing the stack
  • Step 3: Deploying an application
  • Step 4: Monitoring the stack

They include screenshots of the web-based interfaces you'll use to complete each of these steps, giving you a great visual guide to where you should be and what things should look like. In the end you'll have a simple application, running in AWS on Zend Server you can easily monitor and configure.

tagged: zendserver tutorial elastic aws amazon webservices setup configure guide

Link: http://www.sitepoint.com/running-an-elastic-lamp-stack-on-aws/

Zend Blog:
Running a PHP Cluster on AWS
Dec 24, 2015 @ 10:33:17

On the Zend Blog they've posted a new guide showing you how to create a PHP cluster in AWS using the Zend Server software to help make things easier.

Running a cluster of PHP servers on AWS can be a complex task to say the least, and in this article we will look into the various tasks involved in managing a PHP clustered environment. We will look into why it can be a complex and tricky task and how Zend Server help alleviate the pain involved.

They start by introducing the guidelines of the challenge, easily creating the set of PHP nodes with simpler maintenance abilities, monitoring and session sharing included. While this isn't a step-by-step guide per-se, it does give you a good idea of some of the technology needs around clustering PHP instances (and how Zend Server (Cluster) helps solve some common issues). This includes screenshots of the interfaces used for these common tasks like:

  • Upgrading and synchronizing PHP code
  • Propagation of changes in PHP configuration
  • Monitoring of PHP log and events
  • PHP sessions sharing
tagged: zendserver zend guide aws amazonwebservices cluster zendservercluster

Link: http://blog.zend.com/2015/12/22/running-a-php-cluster-on-aws/#.Vnv0ypMrLyI

Piotr Pasich:
Automated deployment with AWS Elastic Beanstalk (EB) – Part II
Aug 07, 2015 @ 09:14:31

Piotr Pasich has posted the second part of his series showing you how to set up an automated deployment process for an environment that includes an Elastic Beanstalk instance. In this part of the series be builds on the process created in part one and shows the setup and configuration of the Beanstalk instance.

In the previous part we set up a dedicated Symfony application on Docker virtual containers and prepared environments that may be transferred between developers during project cycle. The next step is to prepare the application for pushing into the cloud. There are many options available on the market – Heroku, DigitalOcean and, my favorite, AWS Elastic Beanstalk.

He walks you through the Amazon side of things first, getting the Beanstalk instance set up through the AWS control panel, selected from the AWS list of services. He goes through the options you'll need to configure to get the instance all set up and running including the resources to allocate and instance type (t1.medium is recommended). He then helps set up some of the necessary environment variables for configuration information and a bit of a hack to Symfony that lets you override local parameters with ones coming from the environment. Finally he configures the Beanstalk application and setting it up for automated deployment.

tagged: series part2 elasticbeanstalk aws deployment automated tutorial

Link: http://piotrpasich.com/automated-deployment-with-aws-elastic-beanstalk-eb-part-ii

Zend:
Debugging WordPress with Zend Server and Z-Ray on AWS
Aug 05, 2015 @ 11:57:02

The Zend.com blog has a post showing you how to debug WordPress running on Zend Server with the help of the Z-Ray plugin. In their example they're hosting it on an AWS instance, but the same technique can apply on any other hosted version as well.

More and more PHP development is being done in the cloud and on virtual platforms nowadays. The workflow detailed in this brief tutorial is just one way to develop PHP in these environments, but it illustrates just how easy and productive this type of development can be. More specifically, it demonstrates how to launch the newly available Zend Server 8.5 instance on AWS with a WordPress application already deployed, and then use Z-Ray to introspect and debug the code.

The tutorial walks you through the setup and configuration of a new AWS instance with Zend Server and WordPress installed (you can skip to the end if you already have this). They show you how to:

  • Launch the Zend Server AWS instance
  • Configure the instance to install WordPress as a part of the setup process
  • Access the Zend Server control panel
  • Accessing the WordPress application deployed on the instance

Once the WordPress application is accessed, the Z-Ray inspection bar will appear at the bottom giving you insight into various configuration options, performance metrics and server information. They also link to a video with more information about the WordPress plugin.

tagged: zendserver wordpress aws amazon instance zray debug tutorial install configure

Link: http://blog.zend.com/2015/08/04/debugging-wordpress-with-zend-server-and-z-ray-on-aws

X-Team Blog:
Automated Deployment in 90 minutes with Docker, AWS and Codeship
Jul 08, 2015 @ 10:22:27

In the X-Team blog they've posted about deployment, specifically combining Docker and Codeship to push an application (in this case a Symfony2 one) out to an Amazon Web Services instance.

Just imagine. It’s Friday afternoon, the team has just finished a new feature which should be deployed to the servers before the weekend. And you are the lucky guy who is responsible for completing the task. Generally, it shouldn’t take more than five minutes. Well, what could possibly go wrong. [...] In the attached video, you’ll find an introduction on how to setup and automate deployment with Docker, AWS Elastic BeansTalk and Codeship in 90 minutes. Don’t miss a Friday night party ever again!

The tutorial comes in the form of a video screencasting the whole process, all the way from setting up the AWS instance and Codeship account out to the configuration and software you'll need to use Docker to build the containers and make the deploy.

tagged: automation docker codeship aws instance tutorial screencast elasticbeanstalk

Link: http://x-team.com/2015/07/automated-deployment-90-minutes-docker-aws-codeship/

Cees-Jan Kiewiet:
AWS PHP SDK Asynchronously
Jun 30, 2015 @ 11:31:15

Cees-Jan Kiewiet has a new post today talking about some interesting trickery he was able to do with the AWS (Amazon Web Services) PHP SDK to allow requests to be made asynchronously.

Just got off the AWS SDK for PHP Office Hour hangout and it was great talking with both team members Jeremy and Michael. And one of the things we talked about was async access to the AWS services using the PHP SDK. The goal of this post is to get the AWS PHP SDK client working asynchronously.

He starts with brief instructions on getting the SDK installed (via Composer) along with a library of his own that brings in a few other dependencies. The ReactPHP event loop is what makes the asynchronous connections possible. He includes the code to create the new handler stack and how to use it to make the asynchronous calls. A demo screencast is also included in the post to illustrate the output from a simple set of requests.

tagged: aws amazon sdk asynchronous connection reactphp event loop tutorial

Link: http://blog.wyrihaximus.net/2015/06/aws-php-sdk-asynchronously/