Questions tagged [php-fpm]

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

PHP-FPM provides a number of useful features over the traditional FastCGI php implementation. It is implemented as a daemon that controls one or more PHP process 'pools' which can be independently configured. Main configuration options for each pool include:

  • Socket on which requests are received (either local or TCP)
  • Separate php.ini settings for specific application requirements
  • Dynamic process control. FPM can dynamically change the number of worker processes depending on pool load.
  • Uid/gid for the pool workers
  • In-flight configuration updates - a change to the pool configuration will be rolled out gracefully across all pool workers without losing connections.
2118 questions
21
votes
2 answers

How and where to configure pm.max_children for php-fpm with Docker?

In a Web application with Nginx and PHP-FPM, I've noticed moments of slowness and analyzing the logs, I found this message, which appears from time to time: [19-Nov-2017 19:24:09] WARNING: [pool www] server reached pm.max_children setting (5),…
lfalmeida
  • 313
  • 1
  • 2
  • 4
19
votes
3 answers

php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

I am stacked with following errors on my site when I test 200 hits per second. First I received 499 errors 2017-04-09 03:22:45 Error 162.158.79.219 499 GET / HTTP/1.1 0 nginx access 2017-04-09 03:22:45 Error 162.158.79.87 499 GET /…
Muhammad Hassaan
  • 409
  • 2
  • 8
  • 18
19
votes
4 answers

nginx / php-fpm error logging

I'm trying to figure out where the PHP errors are going in my setup. I'm running nginx as the reverse proxy to PHP-FPM, but I'm not seeing the various E_NOTICE or E_WARNING messages my app is producing. The only reason I know they're happening is…
Jeremy Wilson
  • 311
  • 1
  • 3
  • 12
19
votes
2 answers

Blank Page: wordpress on nginx+php-fpm

Good day. While this post discusses a similar setup to mine serving blank pages occasionally after having made a successful installation, I am unable to serve anything but blank pages. There are no errors present in /var/log/nginx/error.log,…
troutwine
  • 1,452
  • 5
  • 18
  • 33
18
votes
3 answers

PHP-FPM does not automatically start after reboot

I'm running PHP-FPM and Nginx, occasionally, for whatever reason, I have to reboot the server. Once the server is running again, the nginx service automatically starts, however, PHP-FPM does not. This can be seen when I run the command sudo…
SteveEdson
  • 1,539
  • 3
  • 12
  • 23
16
votes
1 answer

php-fpm: help understanding start_servers, min_spare_servers, max_spare_servers

I'm trying to tune my php-fpm installation for my server, and I have trouble figuring out what to do with the pm.start_servers, pm.min_spare_servers and pm.max_spare_servers variables. I am using pm = dynamic pm.max_children is perfectly clear. Each…
Bintz
  • 395
  • 1
  • 2
  • 10
16
votes
4 answers

Nginx throws 404 only on php scripts using php-fpm

I've installed a testing server using nginx + php-fpm. I've tried all of the following: Nginx + Php5-fpm not rendering php files nginx + php fpm -> 404 php pages - file not found When accessing PHP files, nginx throws an 404 error Summarizing what…
arielnmz
  • 433
  • 1
  • 4
  • 13
16
votes
1 answer

Apache MPMs - Worker vs Prefork

I'm trying to figure out what which is the best Apache MPM I can install on my VPS. I saw some benchmarks and MPM Worker seems to perform better than the Prefork one but for some reason everyone seems to be recommending Prefork over Worker for PHP…
Alix Axel
  • 2,803
  • 6
  • 29
  • 30
15
votes
2 answers

understand correctly pm.max_children tuning

I have done some investigations and I have found this to calculate and adjust pm.max_children value https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/ but for example : I have 8Gb on my server I'm hosting 30…
TooNetCreation
  • 173
  • 1
  • 2
  • 9
15
votes
2 answers

How to pass custom parameters to PHP from Nginx?

I'm using Nginx 1.2.4 in combination with PHP-FPM 5.4.8 with a fastcgi pass and trying to pass custom parameters to PHP. Here are the options I have found so far: using the env directive to set an environment variable in nginx and fetch it with…
Max
  • 3,523
  • 16
  • 53
  • 71
15
votes
1 answer

The strange case of Mr. Time To First Byte

I've got a webserver on a Linode 1024 VPS based on Ubuntu 11.10 Nginx 1.0.5 PHP 5.3.6 (with PHP-FPM, APC) Varnish 3.0.2 And a couple of blogs there based on WordPress 3.3.1. One of them is a plain blog, with the default config, theme and just the…
javipas
  • 1,332
  • 3
  • 23
  • 38
14
votes
2 answers

switch apache from prefork to event in Ubuntu 16, get php 7 working

Apache was running slow in production. After searching for answers for some time, I finally went to #apache IRC channel and the pros had me check the apache mode with this command: sudo apachectl -V and were alarmed to find that Server MPM is…
S. Imp
  • 526
  • 1
  • 4
  • 19
14
votes
2 answers

Nginx caching symlinks

I have a deployment system on my web server, every time an app is deployed it creates a new timestamped directory and symlinks "current" to the new directory. This all workded good and great on apache, but on the new nginx server I've set up, it…
Auris
  • 311
  • 1
  • 3
  • 14
14
votes
3 answers

Override php-fpm pool config values with another file

Having to customize the php-fpm pool configuration of a new server, I wonder if it is possible / allowed / recommended to have a new pool file, which name goes alphabetically after the original one, which only has values that override the initial…
Déjà vu
  • 5,546
  • 9
  • 36
  • 55
14
votes
7 answers

Nginx + php5-fpm = "File not found"

I've hit a wall whilst setting up a site using nginx / fpm. The page displays "File not found", and this appears in the nginx error.log: FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream I'm new to both…
Mathew
  • 287
  • 1
  • 3
  • 9