So I’m trying to make the linux level 4 lab 8
But when I do yum list php-fpm i just get this info:
php-fpm.x86_64 8.0.30-3.el9 appstream
Which it seems that I can’t install the 8.2 version with the centos repository, since I updated the package database also.
So can you clarify what should I do here ? I should get an external repo to install php-fpm in this lab ?
EDIT:
I’m trying to install the remi repo to install newer php-fpm but it’s not possible, the terminal shows me 404 errors. Can you please explain how should I can install the desired version for php-fpm ?
Hi @carlos140
You need to use the correct Remi’s RPM repository, which is the main source for PHP packages on CentOS. You can check the guide here: Install PHP 8.2 on Fedora, RHEL, CentOS, Alma, Rocky or other clone - Remi's RPM repository - Blog
1 Like
Thanks for the info @raymond.baoly ! But I was able to found the dnf modules and install it by that way instead of adding the remi repo
. Now today I finally ended all the Linux levels in KK engineer 
But I have a question: Why in the lab of setup nginx with php-fpm with Ip-address and not unix socket, the nginx.conf file need this to work ?
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I dont get this line:
fastcgi_pass php-fpm;
Why not this ?
fastcgi_pass 127.0.0.1:port-number;
Hi @carlos140
As I understand it:
- Use the
php-fpm alias (upstream) for local setups on the same server as Nginx, usually with Unix sockets.
- Use
IP:port for direct or remote connections to PHP-FPM.
Since the PHP-FPM server is on the same machine as Nginx in this case, we should use the php-fpm alias.
Okey I get it, but in my case it was the lab where you should not use the unix socket, so you must use tcp. Why it’s not possible to put the ip 127.0.0.1:port in the nginx configuration file ? Does system-d make some association with php-fpm as a service ? Since in reality if both nginx and php-fpm are in the same ip address, I believe that should work, since the main issue is to avoid some duplication of ports. So in theory if nginx was in port 80, then 127.0.0.1:80 for nginx server and 127.0.0.1:9000 in the nginx config file for declaring the ip and port available to work with php-fpm should work if php-fpm config file was setup with the proper ip. So what’s not that the case ?
Hi @carlos140
Is the lab you mentioned this KKE task or a different lab? If it’s a different one, please share the lab link.
It is the KK task mentioned. The unix socket version one is the number 9. If I’m not remembering wrong also the lab number 7 of the level four does make you use the socket. But the lab 8 is about making it work with Ip address only. So just tcp.