Knowledgebase

Apache & PHP

Apache and PHP

Articles

Nginx Configuration Explained: File Locations, Server Blocks and nginx -t Nginx 1.26.3 on Debian 13, 1.24.0 on Ubuntu 24.04, 1.28.3 on Ubuntu 26.04 and 1.20.1 on AlmaLinux 9 (tested on all four) Nginx reads one main file, /etc/nginx/nginx.conf, and that file includes the rest. Your website goes into its own small file with a server { } block. After every... Options, IndexOptions, DirectoryIndex, ErrorDocument with .htaccess Updated 22 October 2026 These four .htaccess directives control directory listings, their style, the default index file and custom error pages. 1. Allow or block directory listing When a URL... PHP Compiled as? (Problems with files) Updated 28 September 2026 cPanel & WHM 138, PHP 8.1 to 8.4 This article used to describe PHP 5 running as CGI with phpSuExec. That setup is long gone. This is how PHP runs on current Ucartz cPanel servers, and what it means... PHP Date with Timezone: Set the Default Timezone and List All PHP Timezones PHP 8.3 (8.3.33) and PHP 8.5 (8.5.4 on Ubuntu 26.04 LTS) PHP’s date() uses the default timezone, which is UTC unless you set another one. Set it for one script with date_default_timezone_set('Asia/Kolkata');, or for... PHP Warning: Cannot modify header information, headers already sent It’s a common issue on the sites, PHP Warning: Cannot modify header information: headers already sent, Your site turn to a white page.  It occurs because of... PHP XML, DOM and XSL Extensions: Check, Install and Test XSLT Updated 12 November 2026 PHP 8.4 on Debian 13, PHP 8.3 on AlmaLinux 10, the official php:8.3-cli Docker image, cPanel servers PHP handles XML through six extensions: libxml (the base library), xml (the event-based XML Parser), dom, SimpleXML, XMLReader and XMLWriter. XSLT transformations need... PHP modules installed on the web hosting Updated 28 September 2026 PHP 8.1 to 8.4 on cPanel & WHM 138 (Jupiter theme) Our PHP builds include the extensions most applications need, such as bcmath, curl, dom, exif, fileinfo, gd, gettext, iconv, intl, mbstring, mysqli, openssl, PDO... PHP parsing of files with HTML extension Updated 28 September 2026 cPanel & WHM 138, PHP 8.1 to 8.4 To run PHP code inside files ending in .html, tell the web server to hand those files to PHP. The old line AddType application/x-httpd-php5 .html was for PHP 5 and no... Perl version, Path to Perl and Sendmail Updated 22 October 2026 If you need to find out the Current Versions and Paths to both Perl and Sendmail then simply log into your Cpanel Control Panel and look in the left-hand side column... Permissions of the PHP files Updated 28 September 2026 cPanel & WHM 138 (Jupiter theme) and Apache 2.4 (.htaccess) On cPanel servers, PHP usually runs as your own cPanel user (PHP-FPM, suPHP or LSAPI). PHP files then only need to be readable and writable by you, so use these... Raise the PHP Upload Limit with a php.ini File You can change the upload limit for your domain yourself by adding a php.ini file in the directory where your scripts are started.for Wordpress, you have to place it... Renaming Database Tables with phpMyAdmin Updated 28 September 2026 phpMyAdmin 5.2 in cPanel & WHM 138 Rename a table in phpMyAdmin when an application expects a different name, for example after changing a table prefix. Steps Open phpMyAdmin (in cPanel: Databases ›... Rewrite URLs with mod_rewrite and Apache Rewrite URLs In a block (usually found a virtual host file) or .htaccess file, enable mod_rewrite: Apache Configuration Option RewriteEngine on You may create... Rule-based Access Control for Apache Apache provides a number of tools that allow administrators to control access to specific resources provided by servers. You may already be familiar with... Running SQL Queries on a Database with phpMyAdmin To run SQL queries on a database, first, log in to phpMyAdmin and then do the following: 1. Click the database on the left hand side that you wish to run the SQL... Searching through a Database with phpMyAdmin Updated 28 September 2026 phpMyAdmin 5.2 in cPanel & WHM 138 phpMyAdmin can search every table in a database for a word or value, which helps you find where a setting or old URL is stored. Steps Open phpMyAdmin (in cPanel:... Starting html as a php file in suphp Updated 28 September 2026 cPanel & WHM 138, PHP 8.1 to 8.4 suPHP and the PHP 5 handlers are obsolete. On current cPanel servers, the handler that runs PHP depends on your PHP version; this is how to run .html files as PHP... Tuning Your Apache Server Updated 28 September 2026 Apache 2.4 with PHP-FPM Apache 2.4 performs well when configured for your traffic and memory. These settings apply to current Apache versions (the old prefork-only advice for Apache 2.2 is... Update your Apache version in cPanel Updated 28 September 2026 cPanel & WHM 138 (WHM, root access) On cPanel servers, Apache is provided by EasyApache 4 as normal system packages (ea-apache24). It is updated with the rest of the system, so there is no separate... What Are Server Side Includes (SSI) and When to Use Them SSI (Server Side Includes) are directives that are placed in pages and evaluated on the server while the pages are being served. They let you add dynamically generated... What Is GoAccess(A Real-Time Apache and Nginx) And How To Use It? Updated 28 September 2026 Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 (GoAccess 1.11) GoAccess is an open-source, real-time analyser for web server logs. It reads Apache and Nginx access logs and shows visitors, requests, errors, bots, referrers and... What Is a 302 Redirect? 302 Found vs 301, 307 and 308 Apache 2.4, Nginx, PHP and WordPress (tested with Apache 2.4.68, Nginx 1.31.6 and PHP 8.3) 302 Found is a temporary redirect: the server tells the browser that the page is, for now, at another address (given in the Location header). Browsers follow it... What is the path to Perl Updated 28 September 2026 Perl 5 on cPanel & WHM 138 (Jupiter theme) On our Linux servers, Perl is at /usr/bin/perl. Start your Perl CGI scripts with this line: #!/usr/bin/perl Upload scripts in ASCII (text) mode, so the line endings... Where to put CGI files Updated 28 September 2026 Perl 5 on cPanel & WHM 138 (Jupiter theme) CGI scripts (for example in Perl or Python) can run from the cgi-bin folder inside public_html, and from other folders when they use a recognised extension such as... Why there is no package ea-apache24_mod_hostinglimits or ea-apache24_mod_lsapi available? Since EasyApache 4 switched from compiling everything from sources (Apache itself, its modules, PHP, etc) to a RPM based setup (Apache, its modules, PHP, etc are...