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