Author Topic: PHP-FPM Not Working (503 Service Unavailable)  (Read 51074 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #15 on: February 09, 2021, 11:26:50 AM »
You can enable php-fpm at domain level or webserver level. I will tell you about domain level

1)  Go to Webservers -> Domain conf
2) Select the username for domain where you want to activate php-fpm
3) If there is no domain configuration, click the option to create a new configuration
4) In the configuration, select apache->php-fpm. If you are using nginx select nginx -> apache-> php-fpm
5) Select the version of php-fpm that you want
6) Rebuild and save the configuration

You should not get 503 error now on this domain.

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #16 on: February 24, 2021, 07:41:43 AM »
Go to cwp dashboard, then click Webserver Settings->WebServers Conf Editor, Select PHP-FPM menu then click on "/opt/alt/php-fpmxx/usr/etc/php-fpm.d/users/"

Now, click on "Add New Conf File" here you will create filename of your user name account, eg username.conf.

Then try using these code into the file:

[account_username]
listen = /opt/alt/php-fpm74/usr/var/sockets/account_username.sock
listen.allowed_clients = 127.0.0.1

;listen.owner = "account_username"
listen.group = "nobody"
listen.mode = 0660
user = "account_username"
group = "account_username"

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm74/usr/var/log/php-fpm-slowlog-account_username.log

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 15s

;listen.backlog = -1
;request_terminate_timeout = 0s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /home/account_username/tmp
env[TMPDIR] = /home/account_username/tmp
env[TEMP] = /home/account_username/tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin

Change red word and php-fpm version with yours, after finish restart phpfpm : service php-fpm74 restart

You safe my life, thank you so much.
Biswas Host Ltd

www.biswashost.com

Domain, Hosting, Cloud Hosting, VPS, Dedicated Server,

Web Design, SSL, VPN, Professional Email & More

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #17 on: July 15, 2021, 07:02:15 AM »
It worked beautifully! Thanks!
But the question remains: Where is the user's conf file after updating the webserver model????


Go to cwp dashboard, then click Webserver Settings->WebServers Conf Editor, Select PHP-FPM menu then click on "/opt/alt/php-fpmxx/usr/etc/php-fpm.d/users/"

Now, click on "Add New Conf File" here you will create filename of your user name account, eg username.conf.

Then try using these code into the file:

[account_username]
listen = /opt/alt/php-fpm74/usr/var/sockets/account_username.sock
listen.allowed_clients = 127.0.0.1

;listen.owner = "account_username"
listen.group = "nobody"
listen.mode = 0660
user = "account_username"
group = "account_username"

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm74/usr/var/log/php-fpm-slowlog-account_username.log

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 15s

;listen.backlog = -1
;request_terminate_timeout = 0s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /home/account_username/tmp
env[TMPDIR] = /home/account_username/tmp
env[TEMP] = /home/account_username/tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin

Change red word and php-fpm version with yours, after finish restart phpfpm : service php-fpm74 restart

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #18 on: January 09, 2022, 09:12:28 AM »
I got same problem and after investigating my solution was very bizzare....

Problem was that i edit Packages and set open files to -1 (nofile:) section

so open files in domain settings was -1 but that is some bug so config cannot be created. it need to be 0 or more




Offline
***
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #19 on: January 09, 2022, 11:00:11 AM »
I got same problem and after investigating my solution was very bizzare....

Problem was that i edit Packages and set open files to -1 (nofile:) section

so open files in domain settings was -1 but that is some bug so config cannot be created. it need to be 0 or more


You just revived a two year old thread.....
But anyways, if you set unlimited open files to fix your problem, then it wasnt the only problem you're experiencing.... This should not be the fix.

A 503 error code can be seen in the /usr/local/apache/domlogs/* There you can check what the actual problem is...
Or this: journalctl -xe
« Last Edit: January 09, 2022, 11:03:39 AM by iraqiboy90 »

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #20 on: January 09, 2022, 04:22:49 PM »
Problem is that when u set open files to -1 he doesent make shock and php conf file (same one what a guy describe to manualy add it)
so its a bug, problem, or whatever u want call it. Also last post was in july 2021 and now its january 2022 so idk how do u calculate time but as i calculate it pass 5+ months. AND nobody SOLVE a problem. So i post what i find because i face it today with same problem and solve it.

Offline
*
Re: PHP-FPM Not Working (503 Service Unavailable)
« Reply #21 on: March 16, 2024, 05:05:11 PM »
Error:

ERROR failed at quota or security limits

Solved: update package
André Bastos
ISBrasil Hospedagem de Site