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

Colin O'Dell:
How To Install PHP 7.3
Dec 13, 2018 @ 19:51:28

Following the recent release of PHP 7.3, Colin O'Dell has put together a guide for those wanting to install it, walking you through the setup for several popular operating systems.

PHP 7.3 has been released, bringing some great new features to the language such as trailing commas in function calls, throwing errors when JSON parsing fails, array_key_first() / array_key_last() functions, and much more!

In the post he includes instructions for:

  • Ubuntu
  • Debian
  • CentOS / RHEL & Fedora
  • Mac OS X
  • Windows

He even includes instructions for two other tool-based installations: phpbrew and Docker.

tagged: install php73 tutorial linux windows osx phpbrew docker

Link: https://www.colinodell.com/blog/201812/how-install-php-73

CodeWall:
Filtering Faulty HTML Using Purifier Package
Aug 06, 2018 @ 14:22:26

On the CodeWall site there's a tutorial posted showing you how to clean up HTML with the Purifier package, a Composer-installable service provider for Laravel that acts as an interface for the main HTMLPurifier package.

And as every programmer is an artist and makes his/her own copy of CMS to put in the content and publish on a click of a button. Every one of those websites will have a text editor on them, so we can see the result as we write our content.

You can always learn how to integrate a text/html editor on your Laravel installation on one of my posts. We set our own stylesheets for styling various attributes on our content. But for that to work correctly, we need to have a proper HTML code in place.

The tutorial then shows how to install and use the package in your Laravel application. It also includes some advanced steps to publish the configuration file and update its settings (including changes to the allowed HTML tags and allowed CSS properties).

tagged: tutorial laravel htmlpurifier package install configure

Link: https://www.codewall.co.uk/filtering-faulty-html-using-purifier-package/

Tomas Votruba:
Hidden Gems of PHP Packages: NetteUtils
Jul 31, 2018 @ 15:36:37

Tomas Votruba has a new post to his site sharing what he calls a "hidden gem" of a PHP package that he finds useful: the NetteUtils package. This is the first part of a series of posts dedicated to packages he finds helpful.

In this series, I will show you not-so-known PHP packages, that I happily use in my daily workflow. They're hard to describe in few words for their various features, but awesome and simple to use.

Today we start with NetteUtils package.

He starts with a few points about why he uses the library (including mentioning some specific functionality) and how to get it installed in your own application. He then goes through some example code showing the functionality he uses including the Strings and FileSystem classes.

tagged: hiddengem package netteutils detail install usage tutorial

Link: https://www.tomasvotruba.cz/blog/2018/07/30/hidden-gems-of-php-packages-nette-utils/

Symfony Blog:
Creating and updating Symfony projects much faster
Jul 13, 2018 @ 14:58:58

On the Symfony blog there's a post covering some of the recent improvements in the framework that can help to make creating and updating Symfony projects faster via some recent changes speeding up the Composer installation.

A few years ago, we introduced the Symfony Installer as the fastest way to create new Symfony projects. While Composer took up to several minutes to create a new project, Symfony Installer did the same in less than ten seconds.

The trick was that the installer downloaded a ZIP archive with all the dependencies required by the specific Symfony version you were installing, so it was not necessary that Composer resolved the project dependencies.

However, with the release of Symfony 4 we deprecated the Symfony Installer in favor of Composer, because we wanted to use standard development tools as much as possible. Sadly this made creating new Symfony projects slower and, in some cases, it triggered "out of memory" exceptions while Composer was resolving the dependencies.

The post talks about the changes they made to the Composer installation process, mentioning the two major changes: including a composer.lock to prevent version resolution and removal of all legacy Composer tags. They also share some benchmarks for the installation both before and after the changes showing a jump of at least ten seconds post-changes.

tagged: symfony project speed install composer lock tags framework

Link: https://symfony.com/blog/creating-and-updating-symfony-projects-much-faster

TutsPlus.com:
Boost Your Website Performance With PhpFastCache
Jun 05, 2018 @ 17:14:03

The TutsPlus.com site has a new tutorial posted showing you how to boost the performance of your PHP application with the help of PhpFastCache. PhpFastCache is a library that can either be installed manually or via Composer.

PhpFastCache is a library that makes it a breeze to implement caching in your PHP applications. It's an easy-to-use and yet powerful library that provides several APIs to help you implement a caching strategy of your choice without much hassle.

Don't make the mistake of assuming that it's merely a traditional file system caching scheme. In fact, PhpFastCache supports a plethora of adapters that let you choose from high-performance back-ends like Memcache, Redis, MongoDB, CouchDB, and others.

The article starts by helping you install (via Composer) and configure the library with the default file storage method. They talk you through all the code required to configure the caching and using the CacheManager to get and set values as well as checking to see if they're already cached. The tutorial also includes a bonus section showing how to use Redis for the storage rather than local file storage making it easier to share the cache data across multiple systems/servers.

tagged: tutorial phpfastcache caching tool library install configure implement

Link: https://code.tutsplus.com/tutorials/boost-your-website-performance-with-phpfastcache--cms-31031

Jordi Boggiano:
PHP Versions Stats - 2018.1 Edition
May 15, 2018 @ 17:53:09

Jordi Boggiano, lead developer on the Composer project, has posted another of his PHP version statistics posts, this time for the first part of 2018.

It's stats o'clock! See 2014, 2015, 2016.1, 2016.2, 2017.2 for previous similar posts.

A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the <a href="https://packagist.org/>packagist.org logs of the last month for Composer installs done by someone. Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with.

The remainder of the post shares some of the results and differences since November 2017. Among the highlights are:

  • The use of PHP 7.2 has increased by a large percent
  • The use of all over versions (including PHP 7.1) is dropping
  • There is still a large number of packages that only require a version in the PHP 5.x range to be installed

Check out the full post for the complete stats on versions in use and trends (along with some nice graphs of the results).

tagged: composer statistics 2018 version language install require

Link: https://seld.be/notes/php-versions-stats-2018-1-edition

Laravel News:
Speed Up Laravel on Top of Swoole
May 07, 2018 @ 15:47:09

On the Laravel News site there's a tutorial posted showing you how to use the Swole extension to speed up your Laravel-based application. Swole is a PHP extension written in C that provides missing asynchronous functionality to the language.

Swoole is a production-grade async programming framework for PHP. It is a PHP extension written in pure C language, which enables PHP developers to write high-performance, scalable, concurrent TCP, UDP, Unix socket, HTTP, WebSocket services in PHP without too much knowledge of the non-blocking I/O programming and low-level Linux kernel. You can think of Swoole as something like NodeJS but for PHP, with higher performance.

The post covers the "why?" question of using Swoole with Laravel, explaining how the traditional PHP request flow works. Swoole provides a way to reduce come of this processing overhead and increase performance. They then help you integrate Swoole and Laravel using a custom package (swooletw/laravel-swoole), installing both the package and using PECL to install the Swoole extension. Once the extension is enabled and the service provider is added, all it takes is an artisan command to start the web server up.

The post finishes with some quick benchmarks using wrk comparing it against a typical Nginx setup with PHP-FPM. Not surprisingly, Swoole outperforms the other setup well.

tagged: laravel swoole extension performance tutorial package install

Link: https://laravel-news.com/laravel-swoole

Christopher Jones:
Installing XAMPP for PHP and Oracle Database
Feb 23, 2018 @ 15:47:03

On the Oracle and PHP blog today Christopher Jones has posted a tutorial showing you how to install Oracle support in PHP on a XAMPP setup. Oracle support requires the installation of the OCI8 PHP extension.

This post shows how to install XAMPP on Windows to run PHP applications that connect to a remote Oracle Database.

XAMPP is an open source package that contains Apache, PHP and many PHP 'extensions'. One of these extension is PHP OCI8 which connects to Oracle Database.

The post walks you through each of the steps required to get the combination up and running:

  • Downloading and installing XAMPP
  • Ensuring thread safety is enabled
  • Editing the php.ini to enable the OCI8 module
  • Installing the Oracle Instant Client

The post also includes some example code you can use to ensure the connection is up and working, selecting information from the default database.

tagged: oracle xampp tutorial install configure database

Link: https://blogs.oracle.com/opal/installing-xampp-for-php-and-oracle-database

Zend Framework Blog:
Expressive 3 Alpha 3
Feb 09, 2018 @ 15:39:48

On the Zend Framework blog today project lead Matthew Weier O'Phinney has posted an announcement about the latest (alpha) release of the Zend Expressive framework: Zend Expressive 3 Alpha 3.

Today, we pushed the final changes and fixes that culminated in the Expressive Installer and Skeleton 3.0.0alpha3 release!

The alpha releases have a ton of great features; keep reading to find out more!

The post then walks you through the installation process (slightly different since it's an alpha) and shows the creation of a sample middleware via the command line tooling. The tutorial then shows the creation of a request handler and how to configure it in the router. The post ends with a look ahead it what's next for the framework on its roadmap including several features that need completion before v3 of Zend Expressive can be called complete.

tagged: zendexpressive zendframework v3alpha3 tutorial install middleware handler

Link: https://framework.zend.com/blog/2018-02-08-expressive-3-alpha3.html

Joe Ferguson:
Homestead Welcomes Z-Ray by Zend
Feb 07, 2018 @ 15:41:44

In a post to his site Joe Ferguson, the maintainer on the Laravel Homestead project, has announced a change in the 7.1.0 version: compatibility with Zend's Z-Ray debugging tool.

Since the release of Homestead version 7.1.0 and base box version 5.1.0 Homestead now supports the Zend Z-Ray plugin for PHP 7.2. You can start leveraging the power of Z-Ray in your application with a small changes to your Homestead project.

He includes the instructions to help you upgrade your current installation to this latest versions and the configuration changes required. He also walks through the commands you'll need to use and the resulting output so you can be sure you're on the right track. The end result integrates Z-Ray directly into the site without any additional work.

tagged: laravel homestead zend zray debugging tool install vagrant

Link: https://www.joeferguson.me/homestead-welcomes-z-ray-by-zend/


Trending Topics: