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

SitePoint PHP Blog:
The Ultimate Guide to Deploying PHP Apps in the Cloud
May 12, 2017 @ 12:18:59

On the SitePoint PHP blog author Prosper Otemuyiwa shares what they call the ultimate guide to deploying PHP apps in the cloud with examples for Heroku, Google Cloud, IBM BlueMix, Microsoft Azure, Amazon Web Services and Laravel Forge.

There is a popular mantra amongst developers that goes like this write, test and deploy. In this tutorial, I’ll show you how to deploy your PHP apps to different cloud server platforms such as Google Cloud, Microsoft Azure, Heroku, IBM Bluemix, and others.

Cloud servers are basically virtual servers that run within a cloud computing environment. There are various benefits to hosting and deploying your applications in the cloud. [...] In fact, many companies have moved their infrastructure to the cloud in order to reduce cost and complexity. It’s a great option for small, mid-sized, and enterprise scale businesses. If you write a lot of tutorials and do POCs (Proof-of-concepts) like me, it’s also a great choice for you!

He starts off by covering the technologies that will be involved in each deploy: Linux, Apache, MySQL and of course PHP. Then, for each of the platforms previously mentioned, he goes through the setup and configuration of the same functionality. Most include screenshots of the UI in the service setting up the account and application. He also links to two tools that can make it easier to deploy your actual application to these newly configured cloud instances: Envoyer and Deployer.

tagged: guide deploy application cloud google bluemix azure aws forge

Link: https://www.sitepoint.com/ultimate-guide-deploying-php-apps-cloud/

Amazon Web Services:
PHP application logging with Amazon CloudWatch Logs and Monolog
Apr 24, 2017 @ 09:46:47

On the Amazon Web Services blog there's a new post showing you how to use the Monolog logging library and a custom AWS extension to ship your logs to Amazon CloudWatch quickly and easily.

Logging and information debugging can be approached from a multitude of different angles. Whether you use an application framework or coding from scratch it’s always comforting to have familiar components and tools across different projects. In our examples today, I am going to enable Amazon CloudWatch Logs logging with a PHP application. To accomplish this, I wanted to use an existing solution that is both already popular and well used, and that is standards compliant. For these reasons, we are going to use the open source log library, PHP Monolog (https://github.com/Seldaek/monolog).

They start by introducing the Monolog library for those not familiar with it and how it relates to the PSR-3 standard. The ultimate goal with their implementation is to allow for the logs to be shipped to CloudWatch and implement some alerting around them. The tutorial then kicks in and they show you how to use Composer to install Monolog and an add-on to interface with CloudWatch. Code is provided to set up the initial logger and how to have it to log messages to different places. They then move over to CloudWatch and define a filter for the JSON data to find successful logins to your application. They also show how to use this same functionality in a Laravel application, contained in a test route.

tagged: aws amazon logging cloudwatch monolog tutorial install usage filter

Link: https://aws.amazon.com/blogs/developer/php-application-logging-with-amazon-cloudwatch-logs-and-monolog/

AWS Developer Blog:
Automating the Deployment of Encrypted Web Services with the AWS SDK for PHP (Pa
Feb 17, 2017 @ 12:25:48

The Amazon Web Services blog has posted the second part of their series covering the automated deployment of encrypted web services with the AWS SDK. In this new tutorial (part two, part one is here) they continue with the deployment of services: AWS Elastic Beanstalk, Amazon Route 53 and Amazon CloudFront.

In the first post of this series, we focused on how to use Amazon Route 53 for domain registration and use Amazon Certificate Manager (ACM) to create SSL certificates. With our newly registered domain available for use, we can proceed to deploy and configure the services we need to host the www.dev-null.link website across an encrypted connection. Once complete, the infrastructure configuration will reflect the diagrams [included in the post].

The tutorial then walks you through each of the services you need to deploy and shares the code (using the AWS PHP SDK) to show how to automate the process. There's also a few screenshots included of various page results and admin UIs to help you be sure you're in the right place.

tagged: aws amazon deployment encrypted webservice sdk tutorial series part2

Link: https://aws.amazon.com/blogs/developer/automating-the-deployment-of-encrypted-web-services-with-the-aws-sdk-for-php-part-2/

Scaling Laravel Using AWS Elastic Beanstalk Part 2: Setting up VPC, RDS and Ela
Dec 15, 2016 @ 10:56:06

On the DeliciousBrains.com site they've posted the second part of a series covering the scaling of a Laravel-based application using Elastic Beanstalk (part one is here).

In my last article we decoupled Laravel and got it ready for deployment to the Elastic Beanstalk architecture. However, before we race ahead to actually deploying our code to Elastic Beanstalk we need to do some preparation first. Specifically we need to set up some other AWS services that will be used by our Laravel app. These include: Virtual Private Cloud (VPC) to keep our infrastructure secure, Relational Database Service (RDS) for our MySQL database and ElastiCache for our Redis cache

With these “supporting” services up and running we can finally move on to deploying our Laravel app to Elastic Beanstalk.

They start off by walking you through the creation of the VPC on the AWS services using both public and private subnets. With that in place they move on to the RDS setup, configuring it to host their MySQL database and making a test connection. Finally they set up the ElastiCache instance for the Redis handling finishing out their "supporting services" setup in AWS.

tagged: laravel aws elasticbeanstalk series part2 vpc rds elasticache tutorial

Link: https://deliciousbrains.com/scaling-laravel-using-aws-elastic-beanstalk-part-2-setting-up-vpc-rds-elasticache/

Sending Email with SES in CakePHP 3
Dec 08, 2016 @ 09:31:21

The StarTutorial site has a new article posted showing you how to send email via SES in a CakePHP 3 application. SES is a service from Amazon Web Services that makes it simpler to send emails, the Simple Email Service (SES).

In this tutorial, we will show you how to set up CakePHP 3 to send email with AWS SES via SMTP. In our opinion, integrating AWS SES with CakePHP 3 by SMTP is more straightforward comparing to API.

They start off with the creation of the "EmailTransport" profile configuration dropped into the main application configuration file (defining connection and credential information). They then show how to create an "email profile" telling the framework to use the SES service definition. Finally they offer some advice about using the SES service on a Google Cloud instance and how to work around some of their port restrictions. CakePHP takes care of the rest, automatically understanding how to work with SES and using it transparently as the mailing service when you send your emails.

tagged: cakephp3 tutorial email aws ses send email configuration googlecloud

Link: https://www.startutorial.com/articles/view/sending-email-with-ses-in-cakephp-3

Ben Ramsey:
Building PHP Projects on AWS CodeBuild
Dec 05, 2016 @ 10:54:48

Ben Ramsey has a post to his site sharing the process he's worked up to deploy PHP applications on AWS Codebuild, a new service from Amazon Web Services that fills the niche for an easy to spin up and use build server.

The main highlight of re:Invent is always the keynotes and the new services and features announcements they make during the keynotes. One of the new services caught my attention, and I decided to give it a try. That service is AWS CodeBuild.

CodeBuild is designed to be used as part of the AWS CodePipeline, but it may also be used by itself. [...] Out of the box, CodeBuild provides some managed images that you may use to build your projects. These include environments for Android, Java, Python, Ruby, Golang, and Node.js. PHP is missing from this list, but since you’re able to use other images, I decided to see how easy it is to get up and running on CodeBuild with a PHP project. I chose to try out my ramsey/uuid library for a simple test.

He walks you through the creation of a new CodeBuild instance (complete with screenshots of the UI) and how to configure your project, explaining each of the settings as he goes. He includes the full build command he's using for the library running tests, a lint check and codesniffer checks for formatting. He shows how to get the project to build and what the UI will show when the build is successful (all green).

tagged: project aws codebuild pipeline library tutorial setup build server amazon

Link: https://benramsey.com/blog/2016/12/aws-codebuild-php/

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