Knowledgebase

Apache & PHP

Apache and PHP

Articles

How to Fix 403 forbidden error After Changing the Root Directory in NGINX When accessed PHP files through a browser, may see "NGINX 403 forbidden error". Here's the error message from NGINX error log /var/log/nginx/error.log. [error]... How to Hide the Apache Version Number? Updated 22 October 2026 Hiding Apache's version number on error pages and in the Server response header is a good security practice: broadcasting the exact software version helps an attacker... How to Host a Website on Localhost (PHP Built-in Server, Docker or XAMPP) Windows, macOS and Linux; tested with the PHP 8.3 built-in server and the php:8.3-apache Docker image (Apache 2.4.68) “Hosting on localhost” means running a website on your own computer, reachable at http://localhost, to build and test it before it goes online. Other... How to Install Apache Cassandra 5 on Ubuntu, Debian, AlmaLinux and Rocky Linux Updated 20 November 2026 Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 (Cassandra 5.0) Apache Cassandra is a distributed NoSQL database with no single point of failure. The current version is 5.0 (4.1 is also still supported). These steps are for Ubuntu... How to Install Apache Cassandra 5 on a Single Server Updated 18 November 2026 Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 (Cassandra 5.0) Ubuntu 17.04 and CentOS 7 are end of life. Apache Cassandra is a distributed NoSQL database for large amounts of data across many servers. The current version is 5.0;... How to Install DSO With mod_ruid2 Using EasyApache 4? DSO stands for Dynamic Shared Object. If you want to increase your website or web app's speed, you need to use DSO. It is one of the many modules available in Apache... How to Install the PHP GeoIP Extension? Updated 28 September 2026 PHP 8.1 and newer (MaxMind GeoIP2 / GeoLite2) The old PHP geoip extension and the legacy GeoIP databases it read are discontinued: MaxMind stopped updating those databases in 2019. Use the GeoIP2 / GeoLite2... How to Send Email from PHP with SMTP (PHPMailer) PHPMailer 7 with PHP 8.1 or later (cPanel hosting, VPS and dedicated servers) PHP’s built-in mail() function sends without logging in, so the mail often lands in spam or isn’t sent at all. Sending through an SMTP account with a login... How to Set Up a Permanent (301) Redirect in Apache: Redirect, RedirectPermanent, RedirectMatch and RewriteRule Updated 8 October 2026 Apache HTTP Server 2.4 (tested on 2.4.69, 2.4.66 on Ubuntu 26.04 and 2.4.63 on AlmaLinux 10) To make a permanent (301) redirect in Apache, add one line to the site’s virtual host or .htaccess file: Redirect permanent "/old-page.html"... How to Stop Google Indexing Pages and Files with .htaccess (X-Robots-Tag noindex) Apache 2.4 with mod_headers (cPanel hosting, VPS and dedicated servers) A noindex rule tells search engines not to show a page or file in their results. For HTML pages you can put it in a meta tag, but PDFs, images and whole folders have... How to Use Apache as a Reverse Proxy (mod_proxy) Apache 2.4 on Ubuntu 24.04, Debian 13, AlmaLinux and Rocky Linux 9 A reverse proxy receives visitors’ requests on ports 80 and 443 and passes them to an application running on another port, such as a Node.js, Python or Java app... How to Use Your Own php.ini File in a Cron Job Updated 12 November 2026 PHP 8.4 CLI with cron 3.0pl1 on Debian 13; cPanel Cron Jobs To make a cron job use your own php.ini, call PHP with the -c option followed by the path to that file, then the script: /usr/bin/php -c... How to do URL redirection URL redirection, or URL forwarding, is a process followed on the web to direct users and search engines from one URL (the source URL) to a different URL (the target... How to enable ODBC on EasyApache 4? 1. First, install the PHP PDO_ODBC module in EA4. 2. Then we have to install Microsoft SQL Server ODBC Driver for Linux, download available at... How to fix Apache Too many connections issue? Updated 22 October 2026 The reasons are the following: - Unoptimized Apache settings The default settings of Apache can induce a heavy load on memory if the sites are content rich dynamic... How to increase PHP memory limit Updated 28 September 2026 cPanel & WHM 138 (Jupiter theme) PHP's memory_limit sets how much memory one PHP script may use. Raise it when you see "Allowed memory size of ... bytes exhausted". In cPanel Log in to cPanel (for... How to increase the size of uploaded files in PHP Updated 28 September 2026 cPanel & WHM 138 (Jupiter theme) Two PHP settings limit uploads: upload_max_filesize (the largest single file) and post_max_size (the whole form submission, which must be at least as large). In... How to install Magento from Softaculous Updated 28 September 2026 Magento Open Source 2.4 Softaculous in cPanel lists Magento among its one-click apps. Before you install it, check the requirements: current Magento (Adobe Commerce open source 2.4) needs a... How to restore PHP Selector options after restore or migration? Updated 28 September 2026 CloudLinux OS with cPanel & WHM On CloudLinux servers, each user's PHP Selector choices (PHP version, extensions and options) are stored in their account. After restoring or migrating an account,... How to use Apache mod_rewrite Updated 28 September 2026 Apache 2.4 (.htaccess) Apache's mod_rewrite changes or redirects URLs with rules in your .htaccess file. It is enabled on our servers; start your rules with RewriteEngine On. Common... Importing Databases and Tables with phpMyAdmin Updated 28 September 2026 phpMyAdmin 5.2 in cPanel & WHM 138 Import an SQL file to restore a backup or load a database from another server. Steps Open phpMyAdmin (in cPanel: Databases › phpMyAdmin) and click the database in the... Inserting Fields into Database Tables with phpMyAdmin Updated 28 September 2026 phpMyAdmin 5.2 in cPanel & WHM 138 Adding a column (field) to a table lets it store new information. Steps Open phpMyAdmin (in cPanel: Databases › phpMyAdmin) and click the database in the left... Internal Server Error or Error 500 The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact your web hosting provider and inform them of the... Managing Resources with Apache mod_alias In many cases, all of the resources served by an Apache host are located in that host’s DocumentRoot. The DocumentRoot is a directory specified in the... Modifying Fields in Database Tables with phpMyAdmin Updated 28 September 2026 phpMyAdmin 5.2 in cPanel & WHM 138 You can change a column's name, type, length or default value in phpMyAdmin. Steps Export the table first.Open phpMyAdmin (in cPanel: Databases › phpMyAdmin) and click...