cPanel

cPanel is an online Linux-based control panel that simplifies website and server management.

cPanel allows you to publish websites, manage domains, organize web files, create email accounts, and more.

www.cpanel.net

Connection refused PHP error in WordPress

While troubleshooting a newish WordPress installation running on LSWS and cPanel I’ve noticed a pretty big error_log file with the following lines: [06-Jun-2021 18:33:14 UTC] Connection refused [06-Jun-2021 18:35:15 UTC] Connection...

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...

How to auto-delete the 🗑️ trash content in cPanel

By default in WHM this setting is set to “Disabled” which means that the content in .trash folder is kept indefinitely. To auto-delete content from the .trash folder for all cPanel users simply do the following: Step 1. login to WHM and...

How to disable Mod_Sec for a specific domain in cPanel

Here is how to disable mod_sec for a single domain name in cPanel. To disable mod_security COMPLETELY, add the following line to the .htaccess file SecFilterEngine Off To only disable HTTP POST scanning, use the following instead: SecFilterScanPOST...

Troubleshooting 🕒 cron job issues on cPanel

Check if Cronjob is properly created The first thing that we need to check when troubleshooting issues with corn jobs on cpanel is if the corn job is properly created. For this we go to cPanel > Cron Jobs Make sure that the cronjob is listed on...

CSF: Check if IP address is blocked on the firewall

Here are different methods to check if an IP address is blocked in Config Server Firewall (CSF). Check if an IP is blocked in CSF from the WHM WHM > Config Server Firewall > Search for IP 2. Check if an IP is blocked in CSF from the terminal: csf -g...

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...

Delete all emails older than 6 months with Cronjob in cPanel

Here is how to delete all emails older than 6 months from cPanel using a cronjob. First, we need to know the exact location where emails are stored. On cPanel, emails are stored in 3 folders: new – incoming emails are received in this...

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...