Programster's Blog

Tutorials focusing on Linux, programming, and open-source

PHP FPM Settings/Configuration Order

A diagram showing how the configuration and settings files override each other in PHP FPM, which may answer your question about why your setting/config file may not be having any effect.

PHP HTML Tidier Middleware

A tutorial providing a PSR-15 compatible middleware that will tidy your HTML response.


Parsing INI Files With PHP

Some tips/tricks to do with parsing INI files in PHP.

Ubuntu 22.04 - Install PHP 8.3

Commands to install PHP 8.2 on Ubuntu 20.04 using Ondrej PPA.

Composer - Please Don't Use --ignore-platform-reqs Flag

A dmonstration video of why I believe you should not use the `--ignore-platform-reqs` composer command flag.

What's New In PHP 8.3

Learn about what's new in PHP 8.3.

Performance benchmark of PHP runtimes From Dzmitry Kazbiarovich

Sharing a performance benchmark article written by Dzmitry Kazbiarovich on PHP runtimes.

Upgrading Ubuntu 22 LAMP Docker Image to HTTP/2

Learn how to configure Apache with PHP to allow HTTP/2 connections.


Ubuntu 22.04 - Install PHP 8.2

Commands to install PHP 8.2 on Ubuntu 20.04 using Ondrej PPA.

Extending Rundeck Image With PHP

Learn how to extend the Rundeck image in order to be able to support local PHP scripts.


PHP - Autoloading Methods

Learn about various autoloading options.

Laravel - Turn Exceptions Into API Responses

Learn how to get Laravel to turn exceptions into legitmate API responses, rather than having to catch them and convert them manually each time.

Laravel Eloquent Relationships

Learn how to define the relationships between models for Eloquent queries in Laravel.

PhpStorm - Add Laravel Autocompletion

Add support for the Laravel Framework to your PhpStorm IDE.

PHPSpreadsheet - Read Excel (.xlsx) File To Array

Read a basic Excel .xlsx spreadsheet into an array as if it was a CSV file.

PHP Enums

Learn about using enums in PHP 8.1+.


Ubuntu 20.04 - Install PHP 8.1

Commands to install PHP 8.1 on Ubuntu 20.04 using Ondrej PPA.

What's New In PHP 8.1

Learn about changes coming in PHP 8.1.

Create Excel (Xslx) Spreadsheets Using PHPSpreadsheet

Learn to use PhpSpreadsheet in order to create Excel (xlsx) files.

Laravel Cheatsheet - Models, Factories, and Database Queries

A cheatsheet for Laravel covering the topics of models, factories, and database queries.

Laravel 5 Cheatsheet

A cheatsheet for using Laravel 5.

Laravel - Use UUID For Model ID

This tutorial will show you how you can quickly add a UUID trait, which you can then add to your models, so that they are using a UUID for their primary key/identifier.

Netbeans - Fix PHP Method Code Completion

Fix method hinting for PHP in Netbeans.

A Really Basic Swoole Threading Example

A really basic multithreading example when using Swoole PHP.

Ubuntu 20 - Install Swoole PHP

Install Swoole PHP on Ubuntu 20.04.

Docker - Create .env File On Startup

Create a .env file on startup of your Docker container.

Getting Started With Laravel Queues and Background Jobs

Learn how to make use of Laravel queues to schedule background (asynchronous) jobs.

Setting Up TOTP in PHP

Get started with using time-based one-time-passwords (TOTP) in PHP for MFA/2FA.

PHP - Working With Large JSON Files

A tutorial on how you can work with extremely large JSON files in PHP

PHP - Fetch Latest Tweets of Specific User

Fetch the latest tweets of a specific user, through the use of the Twitter API.

Composer Install From Private Repository In a Privately Hosted GitLab Server Using GitLab Tokens

Learn how to install packages hosted on a private Gitlab server using Composer and GitLab tokens. This is primarily useful for those setting up CI/CD pipelines with private PHP packages.


Ubuntu 20.04 - Install PHP 8.0

Commands to install PHP 8.0 on Ubuntu 20.04 using Ondrej PPA.

What's New In PHP 8.0

What's new in PHP 8, organized by how useful I find the features.

Laravel - Throw Exception If Environment Variable Not Set

Implement a defensive step in your Laravel framework by throwing an exception if an expected environment variable is not set, rather than reverting back to some default that is probably not appropriate.

Composer - Specify Configuration Environment

Specify the environment in the config section of composer, allowing you to dev for a different environment.


PHP Dotenv

A short tutorial on the Symfony Dotenv package for PHP.

Defensive PHP

A cheatsheet and links for defensive PHP.


Handling File Uploads With PHP

Some tips/advice for handling file upload forms in PHP.

Slim 4 Cheatsheet

A cheatsheet for working with Slim 4

Running Composer Install With Docker

Tips for when using composer on PHP projects that use Docker.


Ubuntu 18.04 - Install PHP 7.4

Install PHP 7.4 on Ubuntu 18.04.

Getting Started With PhpSpreadsheet

Create excel spreadsheets with PHP using a PHP package.

Laravel Blade Views

Tutorial covering the use of Blade views in Laravel.

KVM - Automated Snapshot Pruning Script

A script to automatically prune old snapshots and only keep the last X number.


Ubuntu 18.04 - Install PHP 7.3

Install PHP 7.3 on Ubuntu 18.04.

Debian 9 - Upgrade To PHP 7.3

Install/Upgrade to PHP 7.3 on Debian 9

Debian 9 - Install Later Versions Of PHP

Install later versions of PHP on Debian 9

Creating Github Webhook For Packagist

Learn how to set up a webhook in Github in order to automatically update the package in Packagist.

Ubuntu 18.04 - Deploy Your Own Satis Server

Steps on setting up your own satis server on ubuntu 18.04

Ubuntu 16.04 - Deploy Your Own Satis Server

Steps on setting up your own satis server on ubuntu 16.04

Ubuntu - Install Laravel Installer Through Composer

Install the Laravel installer.


Ubuntu 18.04 - Install Mcrypt for PHP

Install mcrypt for PHP in Ubuntu 18.04

Netbeans - Adding Support for Laravel

Add support for Laravel in Netbeans so that you can get auto-completion and hints working.


PHP Error and Exception Handling

Learn how to register some handlers so that we can capture any kind of issue that occurs in our PHP application.


Cookies in PHP

A tutorial on using PHP to set and read cookies in the user's browser.


PHP - Strict Types

Learn about using declare(strinct_types = 1); in PHP and the implications it has.

Getting Started With Doctrine ORM

Get started with th Doctrine database abastraction layer (DBAL).

Setup Your Own Satis Server For Private PHP Packages

Steps on setting up your own satis server.


PHP - Creating Strict Type Arrays (Collections)

Using strict type arrays in PHP.

Sending Metrics To Statsd With PHP

Start firing data off to your Graphite server's statsd collector in order to start tracking/monitoring events.


Enable PHP Opcache

Enable the PHP opcache


Getting Started With PHP CodeSniffer

Get started with using the codesniffer tool in order to ensure your code adheres to the PSR-2 standards.

Get Started with Satis Using Docker

Deploy your own private satis server for private PHP packages.


PHP Cheatsheet

A cheatsheet for PHP

Slim3 Cheatsheet

A cheatsheet for working with the Slim3 framework.


Creating Phar Files

Create your own phar files.


Ubuntu 16.04 - Install PHP 7.2 From PPA

Install a later version of PHP on Ubuntu 16.04 by using a PPA from Ondrej.

Create Symfony Project

Install the Symfony PHP framework.


PHP - CLI Progress Bar

Have your PHP application show a progress bar whilst it works.

Slim3 - Simplifying Routing At Scale

A video-tutorial demonstrating how you can move a lot of the routing registration in Slim3, into the controllers, thus simplifying your codebase if you have a lot of routes.

PHP - Using UUID Instead of Auto Increment or Sequence

Learn how to use UUIDs in MySQL for your table IDs, rather than using auto_increment.

PHP Lecture - Identify All the Things With UUIDs!

A lightning talk on UUIDs from the maintainer of the ramsey/UUID package library for PHP.

PHP - Doctrine ORM Good Practices and Tricks

A talk made by Macro Pivetta on "Doctrice ORM Good Practices and Tricks".


PHP - Finally Clause

Learn about the finally clause.

PHP Packages - Requiring Self For Testing

Learn how to include your package within itself for testing and not have to keep pushing the code and composer updating.

MySQLi Prepared Statements

A brief tutorial on using prepared statements and their pros/cons.


Ubuntu 16.04 - Install PHP Inotify

Install the Inotify extension for PHP 7.0 in Ubuntu 16.04

Composer Aliases

How you can use aliases for package names for testing dev branches.

Compile PHP 7.2 with pthreads

Install PHP 7.2 With Pthreads for multithreading

PHP Multithreading - Thread Pool Example

An example of using a thread pool for handling threads more efficiently.

Getting Started With Selenium Testing using PHP

Get started with using Selenium for automating tests, and writing those tests in PHP.

Set up Latest Dev PHP with Multithreading on Ubuntu 16.04

This tutorial will show you how to recompile PHP with ZTS enabled, before then adding the pthreads extension in order for us to be able to easily write multithreaded PHP CLI scripts.

Install PHP 7.0 With Pthreads on Ubuntu 16.04

Install PHP 7.0 With Pthreads for multithreading on Ubuntu 16.04

Set Up PHP With Multithreading on Ubuntu 16.04

This tutorial will show you how to recompile PHP with ZTS enabled, before then adding the pthreads extension in order for us to be able to easily write multithreaded PHP CLI scripts.


PHP - The Importance of Actually Implementing The Interface

An example of why you need to use the implements keyword on a class to implement an interface, and not just implement its methods.

PHP - Async cURL Requests

PHP - Specifying Package Requirements


PHP - Convert a String to Characters With str_split


PHP - Colon Syntax

Deploy Your Own S3 Server


PHP - Splat Operator

PHP 7 - Spaceship Operator


PHP - Generators

PHP 7.0 - Anonymous Classes

Using DI to Avoid Inheritance

Ubuntu 16.04 - Install GPG Extension for PHP 7

Extremely Defensive PHP

A fantastic timestamped lecture on defensive PHP. Everyone should watch this!

PHP-FPM - Show/Hide Errors

Ubuntu 16.04 - Install NGINX with PHP

PHP - Using Traits

Ubuntu 16.04 - Install PHP SSH2 Extension

FIx Issue With Satis

Fix an issue with Satis not picking up required packages.

Debian 8 - Install GPG Extension for PHP 5.6

Debian 8 - Install PHP 7.1

Dependency Injection

Slim3 - Use Middleware to Check User Is Logged In

Debian 8 - Setting up PHP For Aerospike

Getting Started With Using PostgreSQL in PHP

RabbitMQ Job Queue With PHP

Learn how to make use of RabbitMQ Queues in PHP.

PHP - Install YAML Support

Learn how to use parse and output YAML in PHP.


PHP Gotchas and Tips

PHP Time/Date Cheatsheet

A cheatsheet for working with time in PHP.

PHP - Converting Data for Google Charts

Laravel Cheatsheet

A cheatsheet for using Laravel.

Fixing Laravel 4 Routing Autocomplete

If you use netbeans like me and new to Laravel, you may get confused/frustrated by lack of autocomplete after typing Route:: This post explains what is going on and how you can fix this.

Using Markdown in PHP Safely

Install Zookeeper PHP Extension


Ubuntu 14.04 - Install PHP 7 From PPA

RabbitMQ Exchanges With PHP


PHP - Callbacks And Sharing Resources

Getting Started with MongoDB GridFS And PHP

Debian 8 - Install MongoDB PHP Driver

PHPUnit - Installation

Install PHPUnit.


PHP - Use the Integrated Webserver for Quick Debugging

Getting Started With PHP And RethinkDB

Ubuntu - Create a Laravel Project

Set up a new Laravel project. Laravel is a popular PHP framework.

Hosting Multiple Dockerized Websites on a Single Host

Debian 7.x - Install PHP 5.6

Install PHP 5.6 in Debian 7.x