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

Dragos Holban:
How to Setup Docker for Your Symfony Project
Sep 18, 2017 @ 11:48:31

In a tutorial posted to his Medium.com site Dragos Holban continues his series walking you through Symfony for PHP applications. In this latest part of the series he shows you how to use Docker to set up an environment for a Symfony-based application.

As you probably know, I am a big Symfony fan :) In the last few years I used Vagrant to set up my Symfony development environment more or less as described here. But we now have Docker and it’s time to move forward with a new setup. Docker containers are generally more lightweight than Vagrant virtual machines, so starting and stopping them is extremely fast. They also take a lot less disk space.

He starts by sharing an example Dockerfile and docker-compose.yml to help set up and configure the environment to be ready for use. The configuration sets up Apache, PHP 7, MySQL, git, Composer and several PHP extensions. It then installs a fresh instance of Symfony and runs a bash file to finish the setup. He shares the contents of this file and the VirtualHost configuration for the web server. Finally he shows how to run the setup via the Docker command line tool and what you can expect to see when things are running smoothly.

tagged: docker symfony setup configure dockerfile compose tutorial series

Link: https://medium.com/@dragosholban/how-to-setup-docker-for-your-symfony-project-ff9b1bf44e68

Delicious Brains Blog:
Running WordPress in a Kubernetes Cluster
Aug 22, 2017 @ 09:35:08

On the Delicious Brains blog Gilbert Pellegrom has written up a post showing you how to get WordPress up and running on a Kubernetes cluster, making use of the helm tool to help with the installation process.

As a developer I try to keep my eye on the progression of technologies that I might not use every day, but are important to understand as they might indirectly affect my work. For example the recent rise of containerization, popularized by Docker, used for hosting web apps at scale. I’m not technically a devops person but as I build web apps on a daily basis it’s good for me to keep my eye on how these technologies are progressing.

[...] In this article, we’re going to start simple and take a look at the Kubernetes platform and how you can set up a WordPress site on a single node cluster on your local machine.

The tutorial then walks you through installing the local Kubernetes using Minikube and, once that's all set up and configured, using Helm to install WordPress in the cluster. He then shows how to scale the installation of WordPress and set up the system for high availability.

tagged: wordpress kubernetes cluster tutorial install configure helm minikube

Link: https://deliciousbrains.com/running-wordpress-kubernetes-cluster/

Twilio Blog:
Creating a Symfony 3 Project with Basic User Handling
Aug 18, 2017 @ 09:56:26

On the Twilio blog they've posted a new tutorial from author Margaret Staples showing you how to create a Symfony 3 project with user handling along with the Friends of Symfony bundle.

User handling is a fundamental part of a ton of web projects. This post will walk through how to get setup using the Symfony 3 framework and the Friends of Symfony bundle so that your project can allow users to register, login and out, and view and edit their User profile. The steps here will serve as a great starting point for your next web project.

She then walks you through the installation of the Symfony standard edition and how to answer some of the interactive setup questions. Once that's set up she shows how to install the FriendsOfSymfony/FOSUserBundle and what configuration options need to be changed to implement it. She then shows how to update the database schema for the new user handling and how to check to be sure the login, registration and profile pages are working as expected.

tagged: symfony3 project user handling tutorial install configure migrate

Link: https://www.twilio.com/blog/2017/08/up-and-running-with-symfony-3.html

Cal Evans:
Mautic Step 2 – Cron Jobs
Jul 11, 2017 @ 09:16:40

Cal Evans has posted the second part of his series as he works through the installation and configuration of the Mautic PHP-based marketing automation tool. In this part of the series he focuses on cron jobs.

This time we are talking about the cron jobs necessary to make Mautic run. Mautic has several commands that are necessary to execute that are not web based. They are run from the command line manually (dumb idea) or using a scheduler like cron on Linux. As with my “Installing Mautic” post, this post is only interesting to those of you self-hosting Mautic.

There is a great manual page on this titles “Cron Jobs”. It tells you a lot of what I’ll tell you here. If you haven’t read it yet, I highly recommend you start there.

He talks about each of the four jobs that, if you're using the system yourself, will want to run often: one for handling segments, two for campaigns and another for sending messages. He also talks about the main problem he ran into during his work with the cron jobs - permissions issues. He shares how he resolved this issue with an extra line in his crontab (after changing the user they ran as) and ends with some extra advice against wide open permissions.

tagged: mautic series part2 install configure cronjob cron tutorial marketing automation

Link: https://blog.calevans.com/2017/07/10/mautic-step-2-cron-jobs/

Symfony Finland:
Drop-dead simple SASS builds in Symfony Flex with Webpack Encore
Jul 10, 2017 @ 10:17:42

The Symfony Finland site has an article posted introducing you to Symfony Encore, a tool that makes it simpler to manage frontend libraries and dependencies via Webpack.

Symfony Encore is a wrapper for the JavaScript module bundler Webpack. Webpack is used to manage Front End assets like JavaScript, CSS and image for browser consumption, often with conversion step from a source format like SASS. Encore provides an opinionated way to add Webpack to your Symfony projects.

[...] Earlier this year I experimented with sharing a state object with Symfony and different front end tools. Recently I ported the Symfony 3 application to Symfony Flex. Now I will continue the evolution of the app by adopting Symfony Encore to the project.

The article briefly introduces Encore and what functionality it provides before getting to the installation (via yarn) and configuration that it installs by default. The post then goes through the setup of SASS, using assets in your pages and running builds.

tagged: symfony tutorial encore webpack assets build sass install configure

Link: https://symfony.fi/entry/drop-dead-simple-sass-builds-in-symfony-flex-with-encore-webpack

Laravel News:
Homeboy Allows You to Automate Adding Sites to Homestead
Jul 10, 2017 @ 09:27:32

On the Laravel News site there's a quick post highlighting a tool that can be use to help automate adding sites to your local Homestead environment - Homeboy.

Homeboy is a new package for Laravel Homestead that allows you to add a new local development site quickly. Once you run the command line tool, it will update your host file to point your dev domain, update your Homestead.yaml file to include mapping to for the new project and create a database mapping, and finally, it’ll re-provision Vagrant.

The post also includes a screencast the project has shared showing the tool in use (though the choice of soundtrack is questionable). It basically works as a shortcut to adding the changes to the files yourself, making it simpler to spin up new sites and environments quickly.

tagged: homeboy laravel homestead environment setup configure tool

Link: https://laravel-news.com/homeboy-allows-you-to-automate-adding-sites-to-homestead

Joe Ferguson:
Install and Configure PHP 7.1 on Cloud 9 Workspaces
Jul 07, 2017 @ 09:32:03

Joe Ferguson has a new post to his site showing you how to install PHP 7.1 on a Cloud9 workspace to get the latest features of PHP (they run PHP 5.5 by default).

July 8th I’m giving a general PHP training day at the Fedex Institute of Technology and because I’m targeting absolute beginners I wanted to use Cloud 9. Cloud 9 is an online editor that gives you a full linux workspace to build your project in. The first thing I noticed was the container Cloud 9 provides is running PHP 5.5.

He provides the contents of the bash script you can run via the Cloud9 interface that will install PHP 7.1 and several dependencies. It also updates a few configurations to work with PHP 7.1 and restarts the Apache instance to have it all take effect. He's posted this as a repository on GitHub to make it even easier and shows how to set up the Cloud9 workspace using it as a base.

tagged: install configure cloud9 workspace install php71 tutorial

Link: https://www.joeferguson.me/install-and-configure-php-7-1-on-cloud-9-workspaces/

CloudWays Blog:
Generate Documentations For PHP Projects Through Sami
Jul 06, 2017 @ 13:47:46

On the CloudWays blog there's a new tutorial posted showing you how to create project documentation with Sami, a tool that takes the DocBlock information already in your code and makes it into something more human-readable.

Developers regularly create large blocks of code that form parts of API’s and other mid to large level projects. While there is a (more or less) agreed upon convention for code writing, every developer has a personal comment and documentation writing standards. Some add small cryptic notes while others attach full-length Google Docs that document the method or class in painful details. This problem becomes very severe when the number of end users increases and there is a need for proper documentation of the project.

[...] DocBlocks are important because they are used by a well known Symfony document generator package called Sami. Very popular in PHP community, Sami also provides the ability to create custom twig templates and work with versioned documentation on GitHub. In this article, I will use Sami and a GitHub project Sync Mysql data with Elasticsearch to automatically generate documentation.

The tutorial then helps you get the Sami package installed via Composer and how to execute it to ensure it's working as expected. Next it points you to a project to clone to help with the MySQL-to-Elasticsearch interface. It then helps with the creation of a configuration file, the results of a build and some additional tips for customizing the configuration for your environment.

tagged: tutorial documentation generation sami docblock install configure theme

Link: https://www.cloudways.com/blog/generate-documentations-for-php-projects-through-sami/

Joe Ferguson:
Using Homestead with CakePHP Framework
Jul 03, 2017 @ 09:10:09

In a new post to his site Joe Ferguson shows you how to use the Homestead VM to run a CakePHP instance for local testing and development needs.

Interested in checking out CakePHP? You can easily spin up a new CakePHP project and add Homestead just as easy as any other modern PHP project.

He then walks you through the setup process:

  • Creating a new project
  • Starting up Homestead
  • Changing the webroot to match CakePHP's needs
  • Bringing up the VM
  • Configuring the database

Each step is accompanied by screenshots and/or console output to help you ensure you're on the right track.

tagged: homestead cakephp framework tutorial install configure

Link: https://www.joeferguson.me/using-homestead-with-cakephp-framework/

SitePoint PHP Blog:
Getting Started with Sulu CMS on Vagrant The Right Way
Jun 05, 2017 @ 15:15:10

The SitePoint PHP blog has posted a tutorial showing you how to get started with Sulu CMS and Vagrant. Sulu CMS is a content management system based on Symfony.

In this tutorial, we’ll learn how to get started with Sulu CMS the right way – meaning, we’ll deploy a Sulu “Hello World” instance using Homestead Improved and be mindful of performance issues and configuration values while we’re at it. We’ll also cover some common pitfalls, all in an attempt to get a good base set up for future Sulu tutorials. It is recommended you follow along with the instructions in this post and drop a comment with any problems you might run into.

The tutorial walks you through the installation of the Sulu CMS instance but you'll need to have Vagrant already installed and running. Next up they show you how to configure the system to work along with Vagrant including database setup, running the build and ensuring the system is up and running. There's a bit at the end with some pitfalls and FAQs to help you get started on the right foot.

tagged: sulucms vagrant tutorial install configure

Link: https://www.sitepoint.com/getting-started-sulu-cms-vagrant-right-way/