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
10
votes
2 answers

Access PHP-FPM's /status page manually (bypass Apache)

There is a PHP5.3.3 bug that won't allow me to view php-fpm's /status page via Apache2. Is there a way to manually access this data? I cannot upgrade the box (Ubuntu 10.10, php5.3.4 not supported). I've tried connecting using the technique here:…
mikewaters
  • 1,175
  • 1
  • 14
  • 27
10
votes
1 answer

php5-fpm: bash script to check config before restart

I write a script to create new vhost on Nginx. That script creates Ningx vhost config file, vhost user and dirs, php-fpm pool file. At the end of the script, I would like to check if config is ok before restart php-fpm. For Apache, I do apachectl…
pvledoux
  • 261
  • 1
  • 2
  • 9
9
votes
1 answer

"failed to open stream: Read-only file system" when trying to create file outside webroot with php

I'm trying to setup nextcloud on a RaspberryPi 3 running arch linux (alarm) for a week now. I've setup apache, php with php-fpm, postgresql and installed nextcloud-testing from the AUR (because nextcloud 17 does not support php 7.4). apache's…
random access
  • 93
  • 1
  • 1
  • 4
9
votes
3 answers

nginx and php-fpm: "Primary script unknown" while reading response header from upstream

I want pass any api/* route to php-fpm. Specifically to index.php as I use Symfony. This is the only route that should use php. Anything else will be loaded from /usr/share/nginx/html/public (just HTML files and CSS). I've attempted this, but I'm…
BugHunterUK
  • 351
  • 1
  • 3
  • 11
9
votes
2 answers

Does Nginx need to have access to php files

If using nginx + php-fpm, does nginx need to have access to the php files? Context: building a kuberentes pod, with two containers: nginx and php-fpm, we can built the php code into php-fpm container. It's possible to share the php files with…
user455729
  • 91
  • 1
  • 2
9
votes
1 answer

php7.0-fpm.service is masked

I can't seem to get php to start anymore and it's telling me it's masked which from googling appears to be a super disable? Can anyone tell me how to unmask it? What happened was I did some updates sudo apt-get update and then I shutdown my server…
benikens
  • 319
  • 1
  • 2
  • 10
9
votes
3 answers

11: Resource temporarily unavailable, while connecting to upstream + Bad Gateway (Nginx)

For all the sites on my new server, it seems as though once nginx has served some amount of traffic, it starts serving "ERROR 502 - Bad Gateway!". Let's take a look at some logs and config... OS: Ubuntu 16.04 (Server) Hardware: 6 cores, 12GB…
xendi
  • 414
  • 5
  • 10
  • 22
9
votes
1 answer

php-fpm: unrecognized service

I can't seem to restart my php fpm on my Ubuntu server I did ps aux | grep php-fpm I got root 1543 0.0 0.7 444672 7552 ? Ss Nov10 2:14 php-fpm: master process (/etc/php/5.6/fpm/php-fpm.conf) forge 1587 0.0 4.3 687152…
code-8
  • 191
  • 1
  • 1
  • 9
9
votes
2 answers

Configure php-fpm to access environment variables in docker

I'm running php7-fpm in a docker container. However my php scripts aren't able to access environments variables set in my docker-compose file. getenv('MY_ENV_VAR') returns FALSE. I've changed /etc/php/7.0/fpm/pool.d/www.conf to include clear_env =…
Aidan Ewen
  • 291
  • 1
  • 4
  • 11
9
votes
1 answer

FastCGI cache "MISS" due to conflicting headers from PHP application?

I've setup FastCGI cache like this: location ~ \.php(/.*)?$ { fastcgi_cache RWI; fastcgi_cache_valid 200 60m; set $nocache 0; if ($request_method = POST) { set $nocache 1; } if ($http_cookie ~…
9
votes
1 answer

How does PHP5-FPM send errors to nginx?

I've been experimenting a bit with error logging in php-fpm and nginx since I couldn't find any good explanation on the web. Most guides said I should change catch_workers_output to yes if I want to send errors from php5-fpm back to nginx. However,…
Deepak Mittal
  • 191
  • 1
  • 3
9
votes
2 answers

Nginx + php-fpm - Each php-fpm process 70-100% cpu when running

I have a situation in which the following is taking place: We are on linode with 8-core, 8gb of ram , 2.6 ghz - using nginx + php-fpm - we are getting extremely high graphs of cpu usage (which we don't want to be such a bad VPS neighbor)... We…
amurrell
  • 591
  • 1
  • 7
  • 13
9
votes
4 answers

Nginx + PHP-FPM = 502 Bad Gateway

I just spun up a new Rackspace cloud server and ran the following: apt-get install php5 nginx php-fpm When I navigate to the IP address, I see the default Nginx message. I then copied my /etc/nginx/sites-available/default file from another working…
David
  • 845
  • 3
  • 8
  • 10
9
votes
7 answers

Nginx not logging PHP errors

When accessing some PHP scripts on my website, I'm getting the dreaded 500 error message. I'd like to know what's wrong to fix it, but Nginx isn't logging any PHP errors in the log file I have specified. This is my server block: server { listen…
James Linton
  • 377
  • 2
  • 5
  • 7
9
votes
2 answers

pecl install mongo - keeps compiling with wrong module API

Working with Ubuntu 12.04 here, nginx and php5-fpm I had mongo working well on php 5.3, then I added the ondrej/php5 ppa and updated to php5.4. It kept GD and CURL extensions, but not mongo. I re-added the line to the php.ini file, and nothing. Then…
kavisiegel
  • 349
  • 1
  • 3
  • 12