Apache & PHP
Apache and PHP
Articles
Add a command/binary to CageFS
What is CageFS?CageFS is a virtualized file system and a set of tools to contain each user in its own 'cage'. Each customer will have its own fully functional CageFS,...
Apache Configuration Structure
Directory and Options
The <Directory> block refers to a directory within the filesystem and specifies Apache’s behavior in that directory. This block is...
Apache Performance Tuning Tips
1. Remove Unused Modules
Save memory by not loading modules that you do not need, including but not limited to mod_php, mod_ruby, mod_perl, etc.
2. Use...
Apache Web Server on Linux: Install It and Host a Website
Apache HTTP Server is in the standard repositories of every major Linux distribution, so installing it is one command: sudo apt install apache2 on Ubuntu and Debian,...
Basic Apache Configuration on Linux (Virtual Hosts, Files and Logs)
Apache HTTP Server is one of the most widely used web servers. Its configuration is plain text files, and the layout differs between the Red Hat family and Debian or...
Becoming Familiar with Databases in phpMyAdmin
To get familiarise with databases in phpMyAdmin, first of all, log in to phpMyAdmin and then follow the below-mentioned steps:
1. From the first screen, you will have...
Can I use short tags in PHP scripts
PHP has two short tags:
<?= (short echo): <?= $name ?> is the same as <?php echo $name; ?>. It is always available and safe to use.<? (short open...
Configure mod_evasive to Help Against Request Floods on Apache
mod_evasive is an Apache module that blocks a client IP address for a short time when it requests too many pages too quickly. It helps against small floods, aggressive...
Copying a Database Table with phpMyAdmin
phpMyAdmin can copy a table within a database or to another database, for example to keep a copy before changes.
Steps
Open phpMyAdmin (in cPanel: Databases ›...
Creating Tables in a Database with phpMyAdmin
To create tables in a database in phpMyAdmin, first log in to phpMyAdmin and do the same:
1. Click the database on the left, which you wish to create tables in.
2....
Deleting Fields from Database Tables with phpMyAdmin
Deleting a column (field) removes it and all its data from every row of the table.
Steps
Export the table first, in case you need the data again.Open phpMyAdmin (in...
Deleting Tables in a Database with phpMyAdmin
To delete tables in phpMyAdmin, open the database, tick the tables in the Structure list, choose Drop from the With selected: menu and click Yes to confirm. Dropping a...
Disable TRACE or TRACK method in Apache web server
If you like to keep your VPS hosting server or dedicated server secure you may need to disable TRACE or TRACK methods for Apache web server. We highly recommended this...
Do You Support WebDAV? cPanel Web Disk Explained
Yes. On cPanel hosting, WebDAV is provided by the Web Disk feature (Files > Web Disk in cPanel). It lets you open your hosting files as a network folder on Windows,...
Error 503 on PHP websites when LiteSpeed is used
On servers with LiteSpeed and ConfigServer Firewall (CSF), PHP sites can return "503 Service Unavailable" even though the account is not at its resource limits. A...
Execution of HTML as PHP
By default, the web server sends .html files to the browser as they are, so PHP code inside them is not run. You can change that per website.
Recommended: keep the...
Exporting Databases and Tables with phpMyAdmin
Exporting creates an SQL file of a database or table: a backup you can keep or import elsewhere.
Export a whole database
Open phpMyAdmin (in cPanel: Databases ›...
Fix PEAR Mail Not Loading in cPanel: Set include_path
PHP cannot find Mail.php because cPanel installs your own PEAR packages in a folder inside your home directory (usually /home/USERNAME/php), and that folder is not on...
How To upgrade PHP in InterWorx Server
CentOS 6/7 and PHP 5.4 to 7.1 are end of life, and adding the Remi repository by hand is no longer needed. Current InterWorx versions install several PHP versions...
How to Check Your PHP Version in cPanel and Change It
Each domain in cPanel can use a different PHP version.
Check the version
In cPanel, open Software › MultiPHP Manager. The PHP Version column shows the version for each...
How to Configure ModSecurity With the OWASP Core Rule Set on Apache
ModSecurity is a web application firewall (WAF) module for Apache. Together with the OWASP Core Rule Set (CRS), it blocks common attacks such as SQL injection and...
How to Create a PHP Info File (phpinfo) to Check PHP Settings
A PHP info file is a one-line PHP script that calls phpinfo(). Save this as a file with a .php extension in your website folder and open it in the browser:
<?php...
How to Create a phpinfo Page and Check Your PHP Settings
phpinfo() shows every PHP setting that applies to your website: the PHP version, which php.ini file is loaded, upload limits, memory limit and the installed...
How to Disable mod_pagespeed for a cPanel Account
To disable mod_pagespeed for one cPanel account, add these lines to the .htaccess file in the site's document root (usually public_html):
<IfModule...
How to Enable HTTP/2 in Apache Web Server
Hypertext Transfer Protocol Version 2 (HTTP/2) is the latest version of the HTTP protocol, published as an IETF standard in RFC 7540 in 2015. The focus of the protocol...