I am attempting to run basic PHP scripts on an Amazon Linux 2022 or Amazon Linux 2023 server instance. I followed the directions here and when I request index.html it serves a static page fine. However, when I created the simple index.php page containing only
<?php phpinfo(); ?>
I get an error code 503:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
and
[info] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*:80) failed
[info] [client ip AH01079: failed to make connection to backend: httpd-UDS
I have been working on file permissions and missing packages, but nothing has worked to date. Other searches indicate this could be a permissions issue, but I am unsure what to change. We got the same behavior off of AL2022 and AL2023, but had some success with AmazonLinux 2, possibly because we are not using PHP-FPM on the (much) older image.
What causes this issue and how do I fix it?