Unable to display info.php even after correct configuration

Hi,

I am quite new to using php. However I managed to install rh-php73, and rh-php73-php-fpm.
I started php, and am able to see that php-fpm is running.

[root@dev-mumo run]# ps -ef | grep fpm
root     17722     1  0 17:04 ?        00:00:00 php-fpm: master process (/etc/opt/rh/rh-php73/php-fpm.conf)
apache   17724 17722  0 17:04 ?        00:00:00 php-fpm: pool www
apache   17725 17722  0 17:04 ?        00:00:00 php-fpm: pool www
apache   17726 17722  0 17:04 ?        00:00:00 php-fpm: pool www
apache   17727 17722  0 17:04 ?        00:00:00 php-fpm: pool www
apache   17728 17722  0 17:04 ?        00:00:00 php-fpm: pool www
root     25998  3875  0 19:06 pts/0    00:00:00 grep --color=auto fpm
[root@dev-mumo run]#

The httpd.conf already has the lines for php in it :

<IfModule dir_module>
    #DirectoryIndex index.html
    DirectoryIndex index.php
</IfModule>

<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
 

This is from the httpd error logs :

[Fri Mar 13 18:56:24.996882 2020] [mpm_event:notice] [pid 24751:tid 139821215553728] AH00492: caught SIGWINCH, shutting down gracefully
[Fri Mar 13 18:56:26.110028 2020] [core:notice] [pid 25236:tid 139679729858752] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri Mar 13 18:56:26.111491 2020] [suexec:notice] [pid 25236:tid 139679729858752] AH01232: suEXEC mechanism enabled (wrapper: /opt/rh/httpd24/root/usr/sbin/suexec)
[Fri Mar 13 18:56:26.146706 2020] [lbmethod_heartbeat:notice] [pid 25236:tid 139679729858752] AH02282: No slotmem from mod_heartmonitor
[Fri Mar 13 18:56:26.149897 2020] [mpm_event:notice] [pid 25236:tid 139679729858752] AH00489: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Fri Mar 13 18:56:26.149976 2020] [core:notice] [pid 25236:tid 139679729858752] AH00094: Command line: '/opt/rh/httpd24/root/usr/sbin/httpd -D FOREGROUND'
(END)
  

This is /usr/local/httpd/phpfpm.conf :

[root@dev-mumo conf.d]# cat phpfpm.conf
# Proxy declaration
<Proxy "unix:/var/run/php73.sock|fcgi://php-fpm">
        # we must declare a parameter in here (doesn't matter which) or it'll not register the proxy ahead of time
        ProxySet disablereuse=off
</Proxy>

# Redirect to the proxy
<FilesMatch \.php$>
        SetHandler proxy:fcgi://php-fpm
</FilesMatch>

#
# Allow php to handle Multiviews
#
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

[root@dev-mumo conf.d]#

I have also edited php-fpm.conf & php-fpm.d/www.conf.
The php socket path is /var/run/php73.sock :

[root@dev-mumo run]# pwd
/var/run
[root@dev-mumo run]# ls -la | grep php
srw-rw----.  1 apache      apache         0 Mar 13 17:04 php73.sock
[root@dev-mumo run]#

I restart httpd after these changes, and still can't see the info.php display. How come?

It turns out that I did not link /usr/local/httpd to the main httpd directory /opt/rh/httpd24/root/etc/httpd .
Once I linked it, and created file phpfpm.conf in the directory, I could see the php page.

1 Like