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

Christoph Rumpel:
The Ultimate BotMan Chatbot Debugging Guide
Nov 19, 2018 @ 11:47:02

Christoph Rumpel, the lead developer on the BotMan PHP chatbot project, has a new post to his site sharing an "ultimate debugging guide" for those having issues with their use of the package.

Starting with BotMan to create chatbots is easy, but dealing with bugs is not. Since there are many external services like Facebook, Telegram or Slack involved, lots of things can and will go wrong. I have run into so many of these bugs and don't want you to struggle with them as I did. So here is my ultimate debugging guide.

The post is broken down into a few different sections, likely related to the questions most asked by users of the BotMan tool:

  • My Chatbot Does Not Respond, What Is Wrong?
  • Facebook Webhook Setup
  • Code Update/Changes Are Not Shown
  • The Loop Problem
  • Laravel Dump Server

Each item in the list comes with a description of the issue, possible steps to resolve it and some links to other tools/resources that can help.

tagged: botman debugging guide ultimate chatbot tutorial

Link: https://christoph-rumpel.com/2018/11/the-ultimate-botman-chatbot-debugging-guide

Laravel News:
Carbon Updates Coming to Laravel 5.8
Oct 11, 2018 @ 09:32:59

On the Laravel News site there's a new post sharing information about an upcoming upgrade for the framework's date handling. In Laravel 5.8, there's plans to update the Carbon library to v2.

Thanks to Carbon maintainer @kylekatarnls you will be able to use Carbon 1.0 or Carbon 2.0 staring in Laravel 5.8. The update includes the ability to use Carbon immutable and even make your application use CarbonImmutable as the default.

[...] According to the laravel/framework pull request you can choose which class you want for dates “such CarbonImmutable, Chronos or simply DateTime.”

For those that want to transition to using some of the features Carbon v2 provides, they've linked to an upgrade guide and some information about how localization will change as a re result of the upgrade.

tagged: carbon datetime handling laravel upgrade guide

Link: https://laravel-news.com/carbon-2-laravel

Delicious Brains:
Hosting WordPress Yourself - Ongoing WordPress Server Optimization & Maintenance
Jul 31, 2018 @ 09:36:54

The Delicious Brains site has posted the final part of their "Hosting WordPress Yourself" series to their site. In this latest tutorial they cover ongoing maintenance tasks for your server to keep it running smoothly and secure.

So you’ve followed our in-depth guide and built yourself a shiny new server that’s secure and tuned for optimal WordPress performance, but what’s next? In this installment of Hosting WordPress Yourself, I’m going to outline a few tasks that should be carried out on a regular basis to ensure that your server continues to run securely and perform well. We’ll look at performing software updates, upgrading PHP, and a few “gotchas” to watch out for that we may have experienced ourselves. Let’s dive straight in!

The article is broken up into several sections, each with a summary providing a bit more background:

  • Keep Plugins and Themes Updated
  • Check Backups are Running
  • Keep an Eye on Server Metrics
  • Watch Those Log Files
  • Update Server Packages
  • Upgrade PHP

They also talk about upgrading the OS itself (Ubuntu) and how to outline an action plan that, when used regularly, can keep your system and software up-to-date easily.

tagged: wordpress hosting guide tutorial series part11 ongoing maintenance

Link: https://deliciousbrains.com/hosting-wordpress-yourself-server-maintenance/

Delicious Brains:
Hosting WordPress Yourself 2018 Update
Jun 13, 2018 @ 09:33:33

The Delicious Brains site has posted an update for the last part (10 of 10) of their series providing a guide to hosting WordPress yourself for some smaller changes for doing it in 2018.

I originally started writing Hosting WordPress Yourself back in February 2015, which makes this series over three years old! During that time a lot has changed, which is why I updated the series just over 12 months ago, to keep the content relevant. Since then, even more has changed in the WordPress hosting scene, so it’s time for another update!

I have already updated the existing articles in this series with the changes that follow. This article serves as a changelog and documents what has changed in each part of this series, where I guide you through the process of building a complete server to house your WordPress sites

This update shares changes in the virtual server setup, new software releases, suggestions of server monitoring services and web server configuration changes. Each point in the list is also linked back to the other part of the series related to the changes to give more context.

tagged: wordpress hosting guide tutorial series 2018 update

Link: https://deliciousbrains.com/hosting-wordpress-yourself-2018-update/

Andrew Embler:
A Concrete Guide to Dependency Injection
Mar 05, 2018 @ 13:54:48

In a new post to his site Andrew Embler provides a concrete guide to dependency injection, a look at some of the foundational principles behind dependency injection, some problems and how they could be resolved.

As we develop concrete5, we are very conscious about keeping the code base modern, so that we don't have to go through a massive, painful rewrite like we did with version 5.7. This means that we're frequently deep in the weeds, applying new concepts and functionality to new and old code alike.

[...] Here, we're going to talk about Dependency Injection. There are numerous tutorials, blog posts and Stack Overflow questions, regarding Dependency Injection – but there's always room for some more.

He starts with a look at the "old days" where dependencies were created inside of the class methods as needed and not shared. He then covers some of the problems with this approach and how a move to dependency injection (DI) can help. In his example a database object instance is created inside of the method each time it's' needed. The move to DI helps to resolve those issues by passing in the database instance instead. He finishes the post trying to clear up some of the terminology confusions around DI and briefly mentions containers (dependency injection containers) and the role they play.

tagged: dependency injection tutorial introduction guide

Link: http://andrewembler.com/2018/03/concrete-guide-dependency-injection

Paragon Initiative:
The 2018 Guide to Building Secure PHP Software
Dec 12, 2017 @ 12:16:13

On the Paragon Initiative blog has a new post that shares some of their own tips and tricks of how to building secure PHP applications moving forward in to 2018.

As the year 2018 approaches, technologists in general—and web developers in particular—must discard many of their old practices and beliefs about developing secure PHP applications. This is especially true for anyone who does not believe such a feat is even possible.

This guide should serve as a complement to the e-book, PHP: The Right Way, with a strong emphasis on security and not general PHP programmer topics (e.g. code style).

The guide covers a wide rang of topics that can help you secure your applications (and not just PHP ones either) including:

  • working with security headers
  • safely handling file uploads
  • effective password hashing
  • general-purpose cryptography
  • searchable encryption
  • event logging with Chronicle

Each item in the list is a link to another part of the guide where the topic is discussed. In each there's plenty of good information about prevention and implementation as well as links to other tutorials and packages that can help.

tagged: secure application development guide 2018 introduction

Link: https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software

Colin O'Dell:
Installing PHP 7.2
Dec 01, 2017 @ 09:26:56

Right on the heels of the release of PHP 7.2.0, Colin O'Dell has posted a guide to installing it on several different operating systems.

type hints, saner count() behavior, and much more.

He then provides the commands you'll need to get your OS of choice updated (well, most of the popular ones at least):

  • Ubuntu 14.04, 16.04, 17.04, & 17.10
  • Debian 8 (Jessie) and 9 (Stretch)
  • Debian 7 (Wheezy)
  • CentOS / RHEL 6+ & Fedora 25+
  • Mac OS X
  • Windows
  • phpbrew
  • Docker

Each includes the command(s) you'll need to grab the package and perform the installation. If you need something more customized or your OS isn't listed, you can always compile from source too.

tagged: install php72 guide unix osx windows docker phpenv

Link: https://www.colinodell.com/blog/201711/installing-php-72

Paragon Initiative:
Libsodium Quick Reference: Similarly-Named Functions and Their Use-Cases
Jun 13, 2017 @ 12:17:55

In a new post to the Paragon Initiative blog Scott Arciszewski has shared a helpful reference for those that might be a little confused by the naming and functions involved in the use of libsodium in PHP. In this quick reference he lists out each of the functions, what type they are and an example use case.

Last Friday at Day Camp 4 Developers, I presented a talk titled Cooking with Sodium in PHP 7.2, which was largely live-demoing the various cryptography features provided by libsodium. One of the questions I was asked by attendees was about knowing which feature to use to solve specific problems. This is the sort of problem that I suspect many people run into, so here's a quick reference table followed by a detailed explanation.

In the table below, all encryption modes utilize authenticated encryption.

Following the quick reference table he then gets into more detail on each of the functions, describing in depth what they're for and examples of how to most effectively use them.

tagged: quickreference libsodium function guide usecase detail

Link: https://paragonie.com/blog/2017/06/libsodium-quick-reference-quick-comparison-similar-functions-and-which-one-use

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/

SitePoint PHP Blog:
Upgrading from PThreads v2 to V3: What to Look out For
Mar 30, 2017 @ 12:43:15

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he's of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

tagged: pthreads threading version change upgrade guide

Link: https://www.sitepoint.com/upgrading-pthreads-v2-v3-look/