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

Laravel News:
Installing Zend Z-Ray on Homestead
Aug 25, 2015 @ 10:45:01

On the Laravel News site there's a tutorial posted showing you how to Install the Zend Z-Ray tool on Homestead, the popular Laravel-related virtual machine environment. This tool helps with debugging applications by giving you an inside look (a sort of "x-ray") into its inner workings as it executes.

For the past week or so I have been running Zend Z-Ray in Laravel Homestead. Every time using it, new features come to light that are fantastic for debugging your apps in development! What follows is a quick preview of Z-Ray, along with all the steps necessary to install it on Laravel Homestead.

He talks some about the Z-Ray tool and the features it has to offer as well as some of the technologies it supports. He also covers some of the Laravel specific features included like project information, route inspection and current user information. He then gets into the Administration panel, what kinds of information it provides and, finally, how to get it all installed and working. It's not a super simple process but all the commands you'll need are included in the post.

tagged: install zray zend tool plugin laravel tutorial inspect

Link: https://laravel-news.com/2015/08/installing-zend-z-ray-on-homestead/

Rob Allen:
Slim-Csrf with Slim 3
Aug 25, 2015 @ 09:49:48

In a post to his site Rob Allen shows you how to help secure your Slim 3-based applications with the help of the slim3-csrf package. A CSRF (cross-site request forgery) attack happens when another site requests a page in your application, possibly performing an action.

In addition to the core Slim framework, we also ship a number of add-ons that are useful for specific types of problems. One of these is Slim-Csrf which provides CSRF protection. This is middleware that sets a token in the session for every request that you can then set as an hidden input field on a form. When the form is submitted, the middleware checks that the value in the form field matches the value stored in the session. If they match, then the all is okay, but if they don't then an error is raised.

He shows how to add the middleware to your Slim 3 application and how to add the token to each form. The library generates random values for both the name of the token and the value making it compatible with applications that may involve multiple browser windows. He also shows you how to validate the token, either using the built-in "Guard" handling or manually by deferring the check to the route.

tagged: slim3 csrf token package library install configure validate

Link: http://akrabat.com/slim-csrf-with-slim-3/

Dayle Rees:
PHP: The Composer Lock File
Aug 24, 2015 @ 09:17:10

Dayle Rees has a post to his site help to demystify the composer.lock file for the Composer users out there - what it's for, how it works and why you may or may not want to have it in version control.

Everywhere that I go, conference, the supermarket, the dentist, building sites, people always ask me about the Composer lock file. It's a mystery that seems to cause confusion all across the globe. Well, boys and girls, I'm here today to de-mystify the lock file once and for all.

He starts with a new project and some simple dependencies (three of them), two with specific versions defined and one with a wildcard. Once a composer install is run, the packages are downloaded and the composer.lock file is created. He talks about the contents of the lock file and how they relate to the version of the library Composer has installed, the exact version to be precise. He then gets to the question many wonder about the lock file - should I commit it to my version control system? He suggests that, if you need exact versions installed, then yes. This helps keep versions the same across the board of a team and ensures other people working with the library are using compatible library versions. He ends the post talking about how to use the lock file (install vs update) and what changes could be made in one versus the other.

tagged: composer lock file composerlock indepth update install tutorial

Link: http://daylerees.com/the-composer-lock-file/

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

SitePoint PHP Blog:
Introduction to Elasticsearch in PHP
Aug 04, 2015 @ 09:31:05

The SitePoint PHP blog has posted an introduction to using Elasticsearch in your PHP applications. In it author Wern Ancheta covers some of the basics of this powerful tool and helps you get an example script up and running for testing.

In this tutorial, we’re going to take a look at Elasticsearch and how we can use it in PHP. Elasticsearch is an open-source search server based on Apache Lucene. We can use it to perform super fast full-text and other complex searches. It also includes a REST API which allows us to easily issue requests for creating, deleting, updating and retrieving of data.

He starts by helping you get Elasticsearch itself installed via the apt-get package manager (may slightly differ depending on your OS of choice) and tested with a simple web-based request to the port the server is running on. With the server set up he then moves on to the PHP aspect, helping you get the elasticsearch library installed via Composer and creating a new client instance. He then includes code examples of some of the main operations you'll perform with entries in the Elasticsearch instance: inserting a document, updating a document, deleting and - of course - searching for documents matching certain simple and more complex criteria.

tagged: introduction tutorial elasticsearch install library insert update delete search

Link: http://www.sitepoint.com/introduction-to-elasticsearch-in-php/

Remi Collet:
New "remi-php70" repository
Jul 24, 2015 @ 12:09:05

Remi has announced the release of the remi-php7 repo, available for Fedora ≥ 21 and Enterprise Linux ≥ 6.

Current version is PHP 7.0.0beta2 with about 25 extensions which are already compatible. This repository provides development versions which are not suitable for production usage. [...] As for other remi's repositories, it is disabled by default, so the update is an administrator choice.

This repository can be installed just like other similar remi repos via the "yum" command to add the repository to the list of available ones, then another to upgrade the PHP installation.

tagged: php7 remi repository available package yum install beta2

Link: http://blog.remirepo.net/post/2015/07/24/New-remi-php70-repository

Cees-Jan Kiewiet:
Test lowest, current, and highest possible on Travis
Jul 01, 2015 @ 10:57:50

In a new post to his site Cees-Jan Kiewiet talking about "highest" and "lowest" versions of Composer-installed libraries and testing them in Travis-CI builds.

During DPC I've had a talk with Rafael about making sure you test all your possible versions, lowest, current, and highest. The talk was ignited by the infamous composer.lock file (whether to commit it or not).

He goes on to show how you can set up a multiple-version build with the help of the "dependencies" environment variable in your ".travis.yml" configuration file. These are then used in "before_script" commands that tell the Composer install which versions to load. He includes a screenshot of the resulting build and ends with a reminder from Jordi Boggiano (lead developer of Composer) about the resources a build like this takes up and not to do it very often.

tagged: lowest highest library version composer install travisci build

Link: http://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis/

SmartTutorials.com:
Install CakePHP 3 using Composer
Jun 09, 2015 @ 11:42:03

On the SmartTutorials.com site there's an article posted showing how to install CakePHP 3 with Composer, the popular PHP package management tool.

Installation of CakePHP 3 somewhat tricky/difficult for newbies. I will give you step by step instructions to install CakePHP 3 on your machine successfully, All you need to do is just follow this tutorial.

There's a brief section about requirements needed for the system you're installing it onto. Then they break the process up into a few different steps:

  • Installing Composer if you haven't already
  • Install CakePHP 3 using Composer
  • Setting permissions for the temporary (tmp) directory

While their platform choice for the tutorial is Windows, the instructions mostly apply for linux-based systems. There's a few screenshots sprinkled in to show you what things should look like as you go along.

tagged: cakephp3 framework install composer tutorial

Link: http://www.smarttutorials.net/install-cakephp-3-using-composer/

Matt Stauffer:
Installing Sendy (for emails) on Laravel Forge
Jun 05, 2015 @ 09:18:37

In Matt Stauffer's latest post he shows you how to integrate Sendy for sending emails into your Laravel application. This is the first part of a new series.

Last week I decided to finally bite the bullet and take the advice I've been giving so many others: I committed to creating an email newsletter to recap some of my favorite posts and also to give me a space to share some thoughts I don't have space for anywhere else. So, time to get my newsletter-sending-setup up and running.

He starts by explaining his decision to use Sendy, choosing a self-hosted application over a service. There's a one-time fee to purchase it, but it's relatively inexpensive for the features that come bundled. He then gets into the steps to implement it and integrate it into your application:

  • Buy Sendy and prep your code
  • Install Sendy on Forge (with a few sub-points)
  • Set up your domain
  • [Read] Sendy's Getting Started Guide
  • Set up cron jobs
  • [Create] Templates

He also sneaks in a signup form example with a double use - it also signs you up for his newsletter.

tagged: laravel forge sendy application selfhosted install configure tutorial

Link: https://mattstauffer.co/blog/installing-sendy-for-emails-on-laravel-forge

7PHP.com:
Installing Magento version 2 on an AWS (Amazon) Free Tier EC2 Instance On LEMP
May 28, 2015 @ 08:58:05

The 7PHP.com site has a tutorial they've recently posted showing you how to get Magnto 2 installed on an AWS instance running LEMP (Linux, Nginx, MySQL and PHP).

This article tries to demonstrate how to setup an AWS (EC2) instance, installing a LEMP stack, preparing the server environment to meet Magento’s requirements and then to finally install Magento v2 using command line approach. [...] I’m presenting in this article something which might otherwise seem to be a daunting approach – but I also see it as an approach which you can later automate by using Docker/Dockerfile for example or even using a Vagrant appliance.

He takes you through the entire process, including the setup of the account and instance on the AWS side, with screenshots along the way:

  • Creating a Free Tier AWS Account
  • Preparing & Configuring your AWS EC2 Instance
  • Creating A Security Group For Our AWS EC2 Instance
  • Creating a PEM file – Key Pairs
  • Creating our AWS EC2 Instance
  • Creating an Elastic IP & Assigning to our EC2 Instance
  • Preparing & Configuring our AWS EC2 Instance
  • Installing Our LEMP Stack
  • The Magento 2 Project Installation Walkthrough
  • Configuring nginx conf file to serve our magento site
  • Creating a database & running The Magento Setup From Commandline

You'll find all the commands, screenshots and output examples you'll need to follow along with the tutorial easily. There's also links to other resources if you're interested in finding out more about the setup.

tagged: commandline magento2 aws ec2 instance install tutorial stepbystep

Link: http://7php.com/installing-magento-v2-aws-ec2-commandline/