Slim Framwork, not running ... Rocky Linux 9

Hello …

we are migrating a project to a new Rocky 9.1 Linux Server. http php 8.0 / 8.1.
Slim Framework is not running, Installation Step 1 to Step 4 has been performed.

Result: White screen, no Hello World

Here is the httpd debug log of the action.

[Mon Mar 06 10:32:39.766592 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of Require all granted: granted
[Mon Mar 06 10:32:39.766681 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of : granted
[Mon Mar 06 10:32:39.767064 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of Require all granted: granted
[Mon Mar 06 10:32:39.767104 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of : granted
[Mon Mar 06 10:32:39.767336 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of Require all granted: granted
[Mon Mar 06 10:32:39.767370 2023] [authz_core:debug] [pid 89333:tid 89489] mod_authz_core.c(815): [client 172.16.23.14:62706] AH01626: authorization result of : granted
[Mon Mar 06 10:32:39.767443 2023] [proxy:debug] [pid 89333:tid 89489] mod_proxy.c(1512): [client 172.16.23.14:62706] AH01143: Running scheme unix handler (attempt 0)
[Mon Mar 06 10:32:39.767662 2023] [proxy_ajp:debug] [pid 89333:tid 89489] mod_proxy_ajp.c(766): [client 172.16.23.14:62706] AH00894: declining URL fcgi://localhost/var/www/html/Stefan/index.php
[Mon Mar 06 10:32:39.767907 2023] [proxy_fcgi:debug] [pid 89333:tid 89489] mod_proxy_fcgi.c(1054): [client 172.16.23.14:62706] AH01076: url: fcgi://localhost/var/www/html/Stefan/index.php proxyname: (null) proxyport: 0
[Mon Mar 06 10:32:39.767982 2023] [proxy_fcgi:debug] [pid 89333:tid 89489] mod_proxy_fcgi.c(1063): [client 172.16.23.14:62706] AH01078: serving URL fcgi://localhost/var/www/html/Stefan/index.php
[Mon Mar 06 10:32:39.768044 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(2532): AH00942: FCGI: has acquired connection for ()*
[Mon Mar 06 10:32:39.768237 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(2588): [client 172.16.23.14:62706] AH00944: connecting fcgi://localhost/var/www/html/Stefan/index.php to localhost:8000
[Mon Mar 06 10:32:39.768302 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(2624): [client 172.16.23.14:62706] AH02545: fcgi: has determined UDS as /run/php-fpm/www.sock
[Mon Mar 06 10:32:39.768800 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(2814): [client 172.16.23.14:62706] AH00947: connected /var/www/html/Stefan/index.php to httpd-UDS:0
[Mon Mar 06 10:32:39.769029 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(3182): AH02823: FCGI: connection established with Unix domain socket /run/php-fpm/www.sock ()*
[Mon Mar 06 10:32:39.770166 2023] [proxy:debug] [pid 89333:tid 89489] proxy_util.c(2547): AH00943: FCGI: has released connection for ()*

Can you help me, does anyone have any ideas??

Greetings
Hans (Germany)

Based on the provided log, it seems that the proxy is unable to connect to the PHP-FPM daemon.
So your question is more related to DevOps. I think the issue is not Slim itself here.

Here are a few things you can try:

  1. Check the PHP-FPM configuration: Make sure that the PHP-FPM daemon is configured to listen on the correct socket or IP address, and that it is running.
  2. Check the proxy configuration: Make sure that the proxy configuration is pointing to the correct PHP-FPM socket or IP address.
  3. Check the permissions of the PHP-FPM socket: Make sure that the Apache user has permission to access the PHP-FPM socket.
  4. Check the PHP error logs
  5. Enable debug mode (log_level = debug)

Hallo Daniel,
danke für die Infos …

Thanks for the info, I’m one step further…

If I enter the following variable in index.php, does it work?
$app->setBasePath(‘/Stefan’);

Do I have a conf problem on the Rocky http server?

VG in die Schweiz
Hans

Hallo Hans :slight_smile:

The Slim basePath is required when you run your Slim application, not directly under the documentRoot of your web server. According to your log entries, you run Slim in the /var/www/html/Stefan directory under the html directory, so you probably need to set the basePath to /Stefan.

But if you use Nginx, you may not need this at all, because the root directive is the path to your application’s public document root directory anyway. See here: Nginx configuration