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

Laravel News:
Installing Bourbon and Neat with Laravel Elixir
Oct 06, 2016 @ 10:25:09

On the Laravel News site a tutorial has been published showing you how to install Bourbon and Neat with Laravel's "elixir" functionality (a wrapper around the popular Gulp installation tool for Javascript and CSS library handling.

Laravel Elixir is a wrapper that simplifies working with Gulp, it makes compiling, concating, minifying and versioning your JavaScript and CSS files very fluent and easy.

Because many projects using Bootstrap, when you start a new Laravel project, you will find that it is included by default as a basic starting point, but Laravel does not dictate which JavaScript or CSS frameworks you should use. One alternative is Bourbon and Neat created by thoughtbot.

Bourbon is a mixin library for Sass and Neat is a Bourbon addon for creating semantic grids. In this tutorial let’s take a look at how to setup these tools with Laravel Elixir.

They start with a brief overview of the Bourbon tool, showing how it helps to reduce the amount of duplicate code in your source files. There's also a bit about Neat, a responsive grid library that makes it easier to keep your layout "clean and semantic". With those defined they get into the installation of these two packages with two different approaches:

  • First installing Bourbon/Neat via npm then importing them in the SASS config
  • Or installing them via npm, edit the Gulp configuration then import them relatively

With either of these methods in place the Elixir tool can then run the compilation right alongside the other sources and push the resulting CSS out the other side including the Bourbon and Neat functionality.

tagged: laravel install configure elixir bourbon neat semantic clean tutorial

Link: https://laravel-news.com/2016/10/installing-bourbon-neat-laravel-elixir/

Jason McCreary:
Installing Apache, PHP, and MySQL on Mac OS X Sierra
Sep 30, 2016 @ 09:12:28

In a new post to his site Jason McCreary has posted an update to his previous "installing Apache, MySQL and PHP" post with a few changes for macOS Sierra. The changes don't make the installation too much different, however.

Mac OS X runs atop UNIX. So most UNIX software installs easily on Mac OS X. Furthermore, Apache and PHP come packaged with OS X. To create a local web server, all you need to do is configure Apache and install MySQL.

I am aware of the web server software available for Mac OS X, notably MAMP. These get you started quickly. But they forego the learning experience and, as most developers report, can become difficult to manage.

He walks you through the process of getting Apache up and running and the current version of PHP configured and working with it. He shows how to verify PHP is working as expected, how to install the DMG of MySQL and make it also work happily with the PHP installation. There's also a bit at the end you can enable to add in some additional Apache module support for mod_rewrite, mod_expires and mod_deflate.

tagged: install tutorial apache mysql macos sierra

Link: http://jason.pureconcepts.net/2016/09/install-apache-php-mysql-mac-os-x-sierra/

Symfony Finland:
PHP development with Windows Subsystem for Linux (WSL)
Aug 08, 2016 @ 09:48:19

On the Symfony Finland site there's a new article posted talking about the use of the Windows subsystem for Linux, an environment that allows for the execution of Linux binaries in a Windows environment.

Windows has always been somewhat of an oddball when it comes to PHP development. In the past years it has lost out on developer mindshare to UNIX-like Operating Systems like Linux and macOS.

With the release of Windows 10 Anniversary Update in August 2016 Microsoft now offers an interesting option for PHP development in the Windows environment: The Windows Subsystem for Linux (WSL). The Windows Subsystem for Linux allows the execution of Linux binaries in Windows 10. The feature is not enabled by default and is targeted for developers.

They show you how to get into the Linux-compatible shell on your Windows system after enabling it in your System Settings. From there, he says, it's basically like working in a Linux-based server and includes some of the actions he took (including installing PHP 7, Symfony and Composer). He also shows the integration the environment has back with the Windows system including access to local drives (but that there's still some tricky bits involved in using them).

tagged: development windows subsystem linux commandline install symfony environment

Link: https://www.symfony.fi/entry/php-development-with-windows-subsystem-for-linux-wsl

IBM Developer Blog:
Get Started With CouchDB Using PHP and Guzzle
Jul 28, 2016 @ 13:07:48

On the IBM Developer Blog they've posted a new article from Lorna Mitchell helping you get started with CouchDB and Guzzle, making use of this popular HTTP client package to interface with CouchDB's HTTP interface quickly and easily.

In today’s post, we’ll look at how we can use CouchDB in our PHP applications, using the excellent PHP HTTP library Guzzle. Guzzle is a modern, PSR-7 compliant object-oriented PHP library that handles all aspects of HTTP in a correct and — importantly, a scalable — way. So it’s a great way to add any HTTP-interfaced services into your application (PHP 5.5 and later, does support PHP 7).

She then starts off with the installation of Guzzle via Composer and some sample code to make the initial connection to the CouchDB server (either local or remote). With the connection up and working and a "welcome" banner returned, she shows some simple operations like:

  • getting a list of all databases
  • creating a new database
  • inserting and selecting data
  • updating and deleting data

Code is provided for each of these and, thankfully, Guzzle makes it a pretty simple process and handles most of the heavy lifting on the HTTP requests for you.

tagged: couchdb guzzle introduction database http install connect crud

Link: https://developer.ibm.com/clouddataservices/2016/07/27/get-started-with-couchdb-php-guzzle/

Using PHP CodeSniffer With WordPress: Installing and Using the WordPress Rules
Jun 21, 2016 @ 13:21:45

The TutsPlus.com site continues their series covering the use of the PHP_CodeSniffer tool with WordPress in this latest post. In this new tutorial they show you how to install and use the WordPress-specific coding "sniffs".

If you're just joining the series, we've been discussing the topic of code smells, how to refactor them, and tools that are available to help us automate some of the monotony that comes with doing so, especially within PHP programming.

[...] If you've made it this far, I assume you're a WordPress developer, and you're interested in getting PHP CodeSniffer configured such that it can sniff out any problems in your code as it relates to the WordPress Coding Standards. That's good! Because in the remainder of this article, that's exactly what we're going to cover.

The tutorial helps you install the WordPress sniffs and how to add them to the standards supported by your local phpcs installation. The command to execute them against your WordPress plugin is included as well as example output and how to refactor those issues away.

tagged: phpcodesniffer smells tutorial wordpress install setup

Link: http://code.tutsplus.com/tutorials/using-php-codesniffer-with-wordpress-installing-and-using-the-wordpress-rules--cms-26443

Using Let's Encrypt SSL With Your WordPress Project
May 24, 2016 @ 12:53:11

The TutsPlus.com site has posted a tutorial for the WordPress users out there about using Let's Encrypt and SSL certificates to easily secure your installation.

For years, purchasing, renewing, installing and managing SSL certificates overwhelmed me with expense and complexity. Now, Let's Encrypt makes it fairly simple and free.

Let’s Encrypt is an emerging, free, automated, and open certificate authority brought to you by a California public benefit corporation called the Internet Security Research Group—it also has nonprofit status. [...] In this tutorial, I'll walk you through installing Let's Encrypt on a few of my websites, including my WordPress consulting website, http://lookahead.io, soon to be https://.

You'll need a be a bit comfortable working at the command line to use the Let's Encrypt client, but they walk you through each step of the process explaining everything along the way. They start with a basic list of features the Let's Encrypt service provides and the requirements you'll need to get started. Screenshots of the setup wizard are included and the "one small difference" you'll need to make when using it with WordPress. They link to the SSL Labs site to help you verify the certificate is working as expected and finish with setting up the auto-renewal of the certificate via a simple cron job.

tagged: wordpress letsencrypt install setup configure ssl certificate free

Link: http://code.tutsplus.com/tutorials/using-lets-encrypt-ssl-with-your-wordpress-project--cms-22303

Mohamed Said:
The magic behind Laravel Valet
May 09, 2016 @ 10:34:19

One of the latest offerings in the Laravel ecosystem, Laravel Valet, was released this past week. It makes setup of new applications simpler and even allows tunneling back from the public web to a local system for easy sharing. In this post to his site Mohamed Said takes a look at the "magic" behind Valet and how it does what it does.

So yesterday Taylor Otwell and Adam Wathan released Laravel Valet, it's simply a tool that helps OS X users easily run their websites locally for development purposes, without the need to configure anything each time a new project needs to be created.

The idea behind valet is that it configures PHP's built-in web server to always run in the background when the operating system starts, then it proxies all requests to a given domain to point to your localhost

He starts by helping you get the tool downloaded (via Composer) and what happens when you run the valet install command. He gets into the detail of each piece that valet sets up:

  • the OS X daemon to run the PHP built-in server
  • the Valet configuration files
  • Dnsmasq (a DNS server)

He then talks about how handles the requests for your local ".dev" sites and the "drivers" it uses to decide which site to serve up.

tagged: laravel valet setup magic install behindthescenes daemon server dnsmasq

Link: http://themsaid.github.io/magic-behind-laravel-valet-20160506/

QaFoo Blog:
Using Mink in PHPUnit
Apr 06, 2016 @ 09:13:30

The QaFoo blog has a new post today showing you how to use Mink with PHPUnit. Mink is a testing tool that allows you to write tests as if they were happening through a browser.

Another day for a short PHPUnit trick. If you want to use PHPunit to control a browser for functional or acceptence tests, then you can easily do this using the Mink library. Mink is well known from the Behat community to facilitate Behaviour-Driven Development (BDD), but it is a standalone library that can be used with PHPUnit just as easily.

This is more flexible than using dedicated browser abstractions such as Selenium directly from PHPunit, because you can switch between different implementations or even run tests with multiple implementations using the same code base.

They start with the command you'll need to get Mink installed via Composer (a simple require) and come example code for a test on the Wikipedia site (the page about PHP). They then refactor this a bit to remove the boostrapping of the Mink client into a reusable trait, making it simpler to use in other tests. They also refactor the test to use the trait and include the phpunit.xml configuration needed to run it.

tagged: mink browser test phpunit install example trait refactor wikipedia

Link: https://qafoo.com/blog/081_phpunit_mink_functional_tests.html

Joe Ferguson:
Adding Homestead to a SlimPHP App
Mar 22, 2016 @ 11:26:09

Joe Ferguson has a quick post to his site today showing you how to use a Homestead VM to run a Slim 3 application with just a few quick commands.

I’ve been a fan of SlimPHP for a really long time. Recently I started using it for a site that I do freelancing development for and wanted to share a quick solution to local development. It’s no secret that I love Laravel’s Homestead vagrant environment. Using the per-project installation method, you are only three commands away from running a SlimPHP skeleton application in a local Homestead VM.

The remainder of the post shows the commands to:

  • create a new Slim application based on the Skeleton
  • Setting up Homestead
  • And creating a new instance to host the Slim application

With a quick vagrant up your virtual machine is ready to go with the application ready to run.

tagged: homestead virtualmachine slim3 slimframework tutorial install composer

Link: https://www.joeferguson.me/adding-homestead-to-a-slimphp-app/

Lorna Mitchell:
PHP 7.0 (and 5.6) on Ubuntu
Feb 11, 2016 @ 10:52:59

In this new post to her site Lorna Mitchell show you how to get both PHP 7 and PHP 5.6 installed on a Ubuntu-based system with the help of a custom PPA (Personal Package Archive).

PHP 7 is released but for those of us who don't usually compile our own PHP, it can be a long wait for our preferred distro to release the packages we want. For Ubuntu, I'm using a PPA which allows both PHP 5.6 and PHP 7.0 to be installed, including things like extensions, at the same time. It was very easy to set up (I'm running Ubuntu 15.10 but this process should also work on older versions back to at least 14.04 which is the previous LTS) so here's a quick walkthrough of what I did.

She then shows you how to:

  • Add the PPA to your system (this one)
  • Install the new versions as expected with apt-get
  • Configuring and switching between versions as needed

She ends the post talking about extensions and the issues that could come up when compiling them against each of the versions. This includes installation instructions so you can easily enable and disable the extensions much like the "sites available" some Apache installations use.

tagged: php7 php56 ubuntu ppa package install custom extension tutorial

Link: http://www.lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu