How to display errors in PHP?

Executing a PHP file can result in an error and there are cases when you don't get any information about the things that went wrong in the process as you could see a blank page or any weird things on the browser. This page explains how to display errors in PHP.

How to display errors in PHP?

These errors are logged in the PHP log file or the server log file, but you can simply make changes to your code to quickly view it on the browser.

How to cherry-pick commit from Github Repository

Many a times, there are changes made to the code on the GitHub repository which you would need to apply on your cloned git version to continue the work done by the others. This requires cherry-pick a commit hash from github. This page helps in knowing how you can cherry-pick commit from Github repository and start with your work on top of it.

PHP Error Log file location in Nginx

PHP error log file location is same as Nginx error log. The Nginx error log and access log file is located at -


To open the file using less command, you can use the +G option to check the latest entries made in the file -

$ less +G /var/log/nginx/error.log

or simply view the last 100 lines using tails command -

tail /var/log/nginx/error.log -n 100


Compress Extract files using tar command

The command "tar" on Linux or Mac OS terminal is used to compress the folder into a tar/archive file. This page helps in the basic usage and explains how to compress extract files using tar command. The description from the man page says - 

tar creates and manipulates streaming archive files.  This implementation can extract from tar, pax, cpio, zip, jar, ar, xar, rpm, 7-zip, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, 7-zip, and shar archives.

Disable elements on drupal webform

Drupal 8 provides an easy way to simply edit the component or element on the drupal webform and disable elements using the checkbox displayed on the form.


disable elements

However, there could be different scenarios where we might need to disable few elements on specific cases that might not available on drupal webform conditional. Eg - Disable elements for certain user roles.

Basic Python Notes with examples

Python is an object-oriented programming language which is gaining popularity in building complex applications. It is used in different fields, eg create web applications, handle big data, perform complex mathematics and also considered by data scientist to analyze their problems. This page is a simple writeup of basic python notes, the code statements which are normally used in almost all the scenarios.