Laravel PHP-FPM Configuration

Resolution for Laravel application PHP-FPM handler not properly configured for both HTTP and HTTPS virtual hosts.

Problem

The Laravel application was encountering an issue where the PHP-FPM handler was not properly configured for both HTTP (:80) and HTTPS (:443) virtual hosts, causing PHP not to execute properly.

Solution

  1. Confirmed PHP 8.3-FPM was installed and running.
  2. Both <VirtualHost> blocks (for :80 and :443) were modified to include the correct socket path for PHP 8.3-FPM.
  3. Updated the <FilesMatch \.php$> directive:
<FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://127.0.0.1"
</FilesMatch>
  1. Both HTTP and HTTPS virtual hosts were modified accordingly.
  2. Apache was restarted to apply changes.
Outcome: The Laravel application is now correctly handling PHP-FPM requests on both HTTP and HTTPS.