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

Christian Scheb:
PHPStorm Inspections for your Continuous Integration Process
Feb 27, 2019 @ 21:24:33

In a new post to his site Christian Scheb has written up a guide to help you set up inspections in PHPStorm to help make your continuous integration process simpler.

Did you know that PHPStorm (or any other Jetbrains IDE) can run inspections from command line and generate XML files for the results? This is a great “hidden” feature of those IDEs and machine-readable output means it can be somehow integrated with a continuous integration (CI) process. So let’s do this!

He walks you through the full process to get the integration set up to easily report the results of various code inspections:

  • Setting Up PHPStorm on a Server
  • Plugin installation (such as the PHP annotations checker)
  • Running the inspections (including configuration)
  • Publishing the result

All commands and configuration examples are included.

tagged: phpstorm continuousintegration inspection tutorial setup configure

Link: https://www.christianscheb.de/archives/808

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/

TutsPlus.com:
Secure, Passwordless Authentication Using Auth0
Jul 10, 2018 @ 16:23:17

On the TutsPlus.com site they've posted a tutorial showing you how to use the Auth0 service to create a passwordless authentication system for your application.

In this article, you'll learn how to set up passwordless authentication using the Auth0 service. Auth0 allows you to outsource authentication features for your app.

Auth0 is an authentication-as-a-service tool that makes implementation of authentication-related features for your app or site a breeze. If you've built an app and you want to just outsource the authentication and authorization features, a service like Auth0 is something you should consider.

The tutorial walks you through the installation and configuration process of their example PHP application including the setup of the .env file to contain the Auth0 secrets. It then provides the code needed to create two kinds of logins:

  • Using email as the identifier
  • Sending the approval via SMS

Both make use of (the Auth0 PHP SDK) to do most of the heavy lifting but there's still a bit of code you'll need to get it up and running.

tagged: passwordless security login auth0 tutorial setup configure

Link: https://code.tutsplus.com/tutorials/secure-passwordless-authentication-using-auth0--cms-31195

Pascal Landau:
Setting up PHP, PHP-FPM and NGINX for local development on Docker (for Windows 10)
Jul 09, 2018 @ 18:19:11

On his site Pascal Landau has posted a complete guide to setting up a Docker-based PHP environment on Windows 10 using Nginx and PHP-FPM.

You probably heard from the new kid around the block called "Docker"? You are a PHP developer and would like to get into that, but you didn't have the time to look into it, yet? Then this tutorial is for you!

[...] This is the first part of a (probably) multi-part series on Docker. The next part will explain how to set up PHP in Docker containers in order to work nicely with PHPStorm when using XDebug.

He starts with a brief overview of why he chose to use Docker and the transition from Vagrant. He then breaks up the tutorial into several different sections, one for each area of the environment:

  • setting up Docker
  • creating the PHP CLI container
  • building the web container (PHP-FPM and Nginx)

He "brings it all together", sharing a docker-compose configuration file that sets up all of the services and configurations in one shot. The tutorial comes complete with screenshots and all command line calls to get your environment up and running quickly.

tagged: nginx docker phpfpm windows10 tutorial setup configure

Link: https://www.pascallandau.com/blog/php-php-fpm-and-nginx-on-docker-in-windows-10/

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

Rob Allen:
Using Serverless Framework with OpenWhisk PHP
May 31, 2018 @ 15:43:01

In a new post to his site Rob Allen provides the steps you'll need to follow to use the Serverless Framework toolkit with OpenWisk to host PHP-based applications.

Serverless Framework is a toolkit to help you mange and deploy a serverless application. (Personally, I'm not a fan of the name as the word "Serverless" already has a meaning in the same space!) It's a useful tool and supports all the major providers, though AWS Lambda seems to be first-among-equals. The OpenWhisk plugin for Serverless is maintained by the rather excellent James Thomas, so if you have any questions, ping him!

As I build more complex PHP based OpenWhisk applications, I thought I'd explore how Serverless makes this easier.

He starts with helping you get the Serverless framework and the related OpenWisk plugin installed. He then helps you create a project, modify the configuration for a simple "Hello world" kind of script and create the PHP script to act as an endpoint. With the setup complete, he includes the steps to deploy and run the project, invoking the action and enabling it (as a Web Action) to make it reachable via the web.

tagged: serverless framework tutorial openwisk helloworld setup configure deploy

Link: https://akrabat.com/using-serverless-framework-with-openwhisk-php/

Amazon AWS:
PHP application logging with Amazon CloudWatch Logs and Monolog
May 07, 2018 @ 14:13:46

The Amazon AWS blog has posted a tutorial helping you get started using Amazon CloudWatch logging from PHP. CloudWatch is a logging service offered by Amazon that comes with features making it easier to track metrics, set alarms and monitor log files.

Logging and information debugging can be approached from a multitude of different angles. Whether you use an application framework or coding from scratch it’s always comforting to have familiar components and tools across different projects. In our examples today, I am going to enable Amazon CloudWatch Logs logging with a PHP application. To accomplish this, I wanted to use an existing solution that is both already popular and well used, and that is standards compliant. For these reasons, we are going to use the open source log library, PHP Monolog.

They start the tutorial with a brief overview of both Monolog and the CloudWatch logging service. From there they help you get the AWS PHP SDK and Monolog installed and an add-on that lets Monolog talk to CouldWatch. The post then provides some example code showing how to set up the PHP-to-CloudWatch connection and what the logging result looks like. They also include instructions on setting up logging filters/metrics and, as a bonus, how to use CloudWatch logging in a Laravel application.

tagged: cloudwatch logging tutorial setup configure monolog addon filter matric

Link: https://aws.amazon.com/blogs/developer/php-application-logging-with-amazon-cloudwatch-logs-and-monolog/

Scotch.io:
Build A Telegram Bot with Laravel and BotMan
Mar 07, 2018 @ 16:17:49

On the Scotch.io site there's a tutorial posted showing you how to create a Telegram bot with BotMan the popular PHP package for creating chatbots.

Being a Scotch.io reader you definitely know that we have covered creating Bots before, we have quite few posts on Slack Bots, Twitter Bots and other related topics [...] But today, we have something different for you, today we will be creating a Telegram bot for dog lovers. Yes, you heard it right. A Telegram Bot for dog lovers using Dog API.

The tutorial then walks through the entire process of getting the bot up and running including:

  • Installation of Laravel and BotMan
  • Creating the commands and testing the bot
  • Installing the Telegram driver and creating the bot
  • Using ngrok to allow external calls to come into your internal application

The post finishes by showing how to link your bot to Telegram and test it out using messages to send you random dog pictures when requested.

tagged: scotchio telegram bot botman tutorial setup configure connect

Link: https://scotch.io/tutorials/build-a-telegram-bot-with-laravel-and-botman

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

Tim MacDonald:
Backup multiple sites and frameworks with 'Laravel Backup'
Nov 01, 2017 @ 15:56:19

In a new post to his site Tim MacDonald covers a Laravel backup package provided from Spatie and how to use it to backup your sites (and not just Laravel ones).

Using Spatie's Laravel Backup package you can backup several sites on a server from a single app install, including Laravel apps and WordPress sites.

Laravel Backup is a fantastic package brought to us by to ever awesome team at Spatie, and is only one of the many great packages they have in the wild. This package makes it super simple to backup your Laravel applications, including all your files and production database, to a 3rd party storage facility, such as Amazon S3.

He then describes his own setup, running a smaller server that hosts several of his sites that use Laravel, WordPress and static content. He needed a backup solution that would allow for him to manage backups for all of them. He then walks through the setup of the package and how to configure it for each site type. The post finishes with the command to execute and run the backup for the site and how to schedule it as a part of the recurring jobs handling.

tagged: laravel backup tutorial introduction setup configure wordpress static

Link: https://timacdonald.me/backup-multiple-sites-frameworks-laravel-backup/


Trending Topics: