Following was my task -
The Nautilus application development team is planning to launch a new PHP-based application, which they want to deploy on Nautilus infra in Stratos DC. The development team had a meeting with the production support team and they have shared some requirements regarding the infrastructure. Below are the requirements they shared:
a. Install nginx on app server 3 , configure it to use port 8095 and its document root should be /var/www/html.
b. Install php-fpm version 8.2 on app server 3, it must use the unix socket /var/run/php-fpm/default.sock (create the parent directories if don’t exist).
c. Configure php-fpm and nginx to work together.
d. Once configured correctly, you can test the website using curl http://stapp03:8095/index.php command from jump host.
Error i got after submitting was - " - either ‘php-fpm’ is not installed or installed version is not ‘8.2’ on App Server 3"
Kindly provide me the steps to install php version 8.2
Following steps i did to accomplish the task
Install Nginx
sudo yum install -y nginx
sudo systemctl enable nginx
Configure NGINX for the app
Edited /etc/nginx/nginx.conf:
sudo vi /etc/nginx/nginx.conf
server {
listen 8093;
listen [::]:8093;
server_name stapp03;
root /var/www/html;
index index.php index.html;
location / {
try_files $uri $uri/ =404;
}
location ~ \ .php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/default.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
sudo systemctl restart nginx
Install PHP-FPM 8.1
sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y
sudo dnf module list php
sudo dnf module enable php:remi-8.1 -y
sudo dnf install php-fpm php php-cli php-common php-mysqlnd php-gd php-xml php-mbstring php-pdo php-opcache -y
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
php-v
sudo systemctl status php-fpm
Configure PHP-FPM
Edited /etc/php-fpm.d/www.conf:
sudo vi /etc/php-fpm.d/www.conf
listen = /var/run/php-fpm/default.sock
;listen.owner = nginx
;listen.group = nginx
;listen.mode = 0660
sudo mkdir -p /var/run/php-fpm
sudo chown -R nginx:nginx /var/run/php-fpm
sudo systemctl enable --now php-fpm
Testing
From the Jump Host, I ran:
Curl… command
Error : php-fpm is not congigured to use ‘/var/run/php-fpm/default.sock’ socket App Server 3
Kindly detect the error in the whole process.
Hi @dpakmishra.1983
It’s worked properly from my end, please try to set these configure below in /etc/php-fpm.d/www.conf.
listen.owner = nginx
listen.group = nginx
raymond.baoly:
nginx
Sir , things are still not working for me with the above configuration.
Inside /etc/php-fpm.d/www.conf, i am changing the following
listen = /var/run/php-fpm/default.sock (removing the default value “/run/php-fpm/www.sock”)
;listen.owner = nginx
;listen.group = nginx
Kindly help.
LSO
August 20, 2025, 6:34pm
#7
You have to uncomment the ;listen.user and ;listen.group by removing the ‘;’
1 Like
This is what i did to accomplish the task:
Install Nginx
sudo yum install -y nginx
sudo systemctl enable nginx
Configure NGINX for the app
Edited /etc/nginx/nginx.conf:
sudo vi /etc/nginx/nginx.conf
server {
listen 8091 ;
listen [::]:8091;
server_name stapp03;
root /var/www/html;
index index.php index.html;
location / {
try_files $uri $uri/ =404;
}
location ~\.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/default.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
sudo systemctl restart nginx
Install PHP-FPM 8.3
sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y
sudo dnf module list php
sudo dnf module enable php:remi-8.3 -y
sudo dnf install php-fpm php php-cli php-common php-mysqlnd php-gd php-xml php-mbstring php-pdo php-opcache -y
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
php -v
sudo systemctl status php-fpm
Configure PHP-FPM
Edited /etc/php-fpm.d/www.conf:
sudo vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen = /var/run/php-fpm/default.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
Also, ensure the directory exists:
sudo mkdir -p /var/run/php-fpm
sudo chown -R nginx:nginx /var/run/php-fpm
sudo systemctl enable --now php-fpm
Testing:
From the Jump Host, I ran:
Curl… command
2 Likes
Thank you for the help @LSO
mahin101
September 13, 2025, 10:06am
#11
I have been able to pass this task following this forum page.
But how would I be able to do it alone?
Can anyone give me any directions about how one would solve this organically?
Specifically the configuration works…
I, by myself, changed the socket path of www.conf file but did not know what else to do.
changed the port and root document path in /etc/nginx/nginx.conf file but that’s it.
rudi
September 28, 2025, 9:40pm
#13
what can be the reason, can any one help ?
Check the port number .
Follow the following steps:
### Task :
The Nautilus application development team is planning to launch a new PHP-based application, which they want to deploy on Nautilus infra in Stratos DC. The development team had a meeting with the production support team and they have shared some requirements regarding the infrastructure. Below are the requirements they shared:
a. Install nginx on app server 1 , configure it to use port 8091 and its document root should be /var/www/html.
b. Install php-fpm version 8.1 on app server 1, it must use the unix socket /var/run/php-fpm/default.sock (create the parent directories if don't exist).
c. Configure php-fpm and nginx to work together.
d. Once configured correctly, you can test the website using curl http://stapp01:8091/index.php command from jump host.
### This is what i did to accomplish the task:
### Install Nginx
```
sudo yum install -y nginx
This file has been truncated. show original
1 Like
rudi
September 29, 2025, 7:46am
#15
Yea, true that is why I confused. I was asked to configure port 8094, so I did
Anywhere else that I need to configure it ??
rudi
September 29, 2025, 3:42pm
#16
I was asked to use port 8094, is there any other configuration needed other than this one ?
/etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen = /var/run/php-fpm/default.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
I missed something else ?? Socket also fine, ownership has given to nginx ... :thinking:
location ~\.php$ { # Consider this line
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/default.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Check the first “line location …” it seems from your screenshot there is a space between the following symbols"~" . There should not be a space between this two symbols.
2nd check the server name in the following lines :
server {
listen 8091 ;
listen [::]:8091;
server_name stapp03; # <----- This line
root /var/www/html;
index index.php index.html index.htm;
rudi
September 29, 2025, 8:45pm
#18
Thank you deepak, but there is something else. still im not able to manage it.