PHP

PHP is a popular general-purpose scripting language that is especially suited to web development PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

www.php.net

PHP handlers Compared

In plain English: PHP handlers are Apache modules that interpret and run PHP code. Using right PHP handler on your website can have a huge impact on the overall performance. In cPanel you can have different PHP versions with different handlers for...

Display the last modified file in directory in cPanel ☑️

From the terminal (SSH): grep -Ril "find /home/username/public_html/ -type f -mtime -2" From a .php file: <?php $last=shell_exec('grep -Ril "find /home/username/public_html/ -type f -mtime -2"'); echo "<pre>$last</pre>"; ?> The output will...

Set default Timezone via htaccess in cPanel

Here in how to change the default Time Zone permanently in cPanel using the .htaccess file Step 1. First, check you current time yone settings using a simple .php script like this: <?php echo "Today is " . date("Y/m/d") . "<br>"; echo "The...

PHP Script to check for open ports

Here is a simple PHP script that you can use to test if a port is open on the server or not. <?php $host = $_SERVER['SERVER_ADDR']; $ports = array(21, 25, 80, 81, 110, 443, 3306); foreach ($ports as $port) { $connection = @fsockopen($host...

Screenshot of the Leaf PHP Mailer 2.8

🍃 LeafMailer – Malicious PHP Mailer script

A few weeks ago I was approached by a friend of mine, complaining about high load and CPU usage on one of his shared hosting servers (DELL) running CentOS 7, CloudLinux and cPanel. I was more than happy to take a look, and after a couple of minutes...

A Simple Generic PHP cURL Class

cURL is a most excellent library that enables you to communicate across a network with a number of protocols. PHP integrated the cURL library early in its development and nowadays its use is widespread across countless applications. To read more...

Murmurhash2 in PHP without the extension

Murmurhash is a nice and speedy hashing algorithm that is handy for creating hash values based on strings. I use it often as benchmarks suggest it is one of the speedier implementations out there. Murmurhash can create 32-bit or 128-bit outputs. In...

Cover Image by MilesAndryPrower on DeviantArt

A Quick and Efficient URL Shortener Using PHP and MySQL

URL shortener’s have proliferated in the past few years, mainly due to the confines of data length that mobile and social networks like Twitter apply. The following code example shows how to make a simple and efficient URL shortener, with plenty...