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
11
votes
1 answer

Differences between mod_fastcgi and mod_proxy_fcgi

I have searched for an answer but cannot seem to find anything substantial related to this question. Should one use mod_proxy_fcgi or mod_fastcgi with php-fpm on Apache2.4? Are there any differences in terms of security and performance? Any…
Reuben Debattista
  • 113
  • 1
  • 2
  • 5
11
votes
3 answers

Serve static content using docker + nginx + php-fpm

I'm trying to configure a php webapp using docker. The idea is to run the app using php-fpm in a standalone container and have another container that will run nginx. The idea for this setup is to use that same nginx container to proxy requests to…
ThisIsErico
  • 221
  • 2
  • 5
11
votes
2 answers

nginx, alias, php-fpm = File not Found

I'm trying to set up nginx with DAViCal. However, I'm getting a "File not Found" with a "FastCGI sent in stderr: "Primary script unknown" in the log. Looks like something is wrong with my aliasing but I sure can't figure it out. My virtual…
Martin
  • 411
  • 1
  • 3
  • 8
11
votes
6 answers

Forwarding PHP requests via ProxyPassMatch as a handler, or only when file exists

I am migrating my server to use mod_proxy_fcgi and php-fpm instead of mod_php. Apache is able to forward .php requests to the fcgi proxy and PHP executes correctly. I've got this working with: ProxyPassMatch ^/(.*\.php(/.*)?)$…
ide
  • 211
  • 1
  • 2
  • 5
11
votes
6 answers

How can I find out why my php5-fpm failed to start?

I get 504 gateway timeout when I try to reach my server. A small check didn't find any logs on php5-fpm logs, but just to make sure, I tried to restart it. When I am trying to restart it: sudo service php5-fpm restart I get [fail], but when I…
Liad Livnat
  • 221
  • 1
  • 3
  • 7
11
votes
2 answers

php-fpm returning empty response to nginx

nginx is connecting to php-fpm over fastcgi, using the standard /etc/nginx/fastcgi_params in the location block. When connecting to /.status (php-fpm.ini::ping.path) from the command line with cgi-fcgi -bind, the result comes back as expected…
David Souther
  • 227
  • 1
  • 2
  • 7
11
votes
1 answer

nginx + php-fpm: how to specify memory limit for an application

With apache+php_mod it was as easy as putting: php_value memory_limit 128M into application vhost. How can I do something like this for nginx+php-fpm?
clime
  • 427
  • 1
  • 7
  • 15
11
votes
2 answers

Nginx + PHP-FPM produce 502 bad gateway instead of fatal error?

I'm currently testing Symfony2 with Nginx and PHP-FPM. I also use Xdebug. Symfony2 comes with a Demo bundle, I wanted to test the new handling of fatal errors which comes with Symfony 2.2.0 by creating a syntax error in the Acme/Demo bundle. Why I…
jchatard
  • 213
  • 2
  • 6
11
votes
3 answers

nginx fastcgi "Primary script unknown" when configuring userdir

I hate configuring nginx. It's so complicated. How do I get PHP to work in my user dirs? Here's the relevant part of my nginx.conf: location ~ ^/~(.+?)(/.*)?$ { autoindex on; autoindex_exact_size off; alias…
nnyby
  • 298
  • 3
  • 5
  • 16
11
votes
1 answer

How to configure PHP-FPM over NGINX to write in per-virtualhost log files

I have Fedora 16 with Nginx and PHP-FPM. Everything is working very good. All logs with PHP notices, warnings, errors etc. are in /var/log/php-fpm/www-error.log. Is there a way to configure PHP-FPM to write errors in proper log files configured as…
B14D3
  • 5,188
  • 15
  • 64
  • 83
10
votes
1 answer

How to forcibly completely clear PHP7 opcache?

The opcache on my webserver keeps hitting the limit I have set even though I feel like I don't have that much PHP code and it really ought to be enough room. This is compounded by the fact that even when clearing the opcache, it immediately shows…
Andrew Stine
  • 101
  • 1
  • 1
  • 4
10
votes
2 answers

nginx php-fpm child exited with code 0

Anyone had a similar problem with php-fpm 7 with 11.0-RELEASE-p8 or know how to debug it? Situation starts after few minutes and show only half pages to clients. Any pages show up about ~62kb of content with ending ��������� 4. Log file of…
busy
  • 281
  • 1
  • 2
  • 8
10
votes
1 answer

Enable error logging on PHP-FPM 7 with Nginx?

This is essentially the same as these questions: https://stackoverflow.com/questions/8677493/php-fpm-doesnt-write-to-error-log Nginx not logging PHP errors BUT the answers there don't seem to be working on Ubuntu 16.04 with PHP…
Nick
  • 4,503
  • 29
  • 69
  • 97
10
votes
4 answers

Webserver randomly serves different vhosts

We've got nginx running on Ubuntu Trusty. It serves several websites over https, running on one ip address. Randomly, although it seems slightly related to work load, sometimes single requests turn up on the wrong vhost. This leads to requests on…
Thom Wiggers
  • 292
  • 1
  • 13
10
votes
1 answer

Setting php values in php-fpm confs instead of php.ini

I'd like to set values in php-fpm conf files what are normally set in php.ini. I'm using nginx. I've created the following setting, but I'm not sure if this would work. php_value[memory_limit] = 96M php_value[max_execution_time] =…
hyperknot
  • 701
  • 2
  • 9
  • 16