Install Apache and PHP on CentOS 7 and actively maintained successorsCopy PagePrerequisitesPrerequisites for CentOS 7(EOL).Installing Apache (httpd)Install ApacheStart and Enable ApacheAllow Web Traffic Through the Firewall (If using OS firewall)Installing PHPCentOS 7AlmaLinux / Rocky Linux / RHEL 8+Connecting PHP to ApacheTest PHP ProcessingPHP-FPM (Recommended for Production)Configure Apache to Use PHP-FPMVirtual HostsCommon TroubleshootingApache won't start — port already in usePermission denied errors on your document rootPHP changes not reflected after editing php.iniConfiguration File ReferenceBest practices