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

learn more… | top users | synonyms (2)

3
votes
2answers
7k views

nginx not able to connect to php-fpm socket

I setup a system similar to the tutorial here: http://vladgh.com/blog/varnish-nginx-and-php-533-ubuntu-1010 I'm having issues with nginx connecting to the php5-fpm socket, but from what I can tell ...
3
votes
4answers
4k views

How to add a pool to FPM (nginx) without reload/restart fpm itself?

Im building an environment (on a ubuntu 10.04.02 machine) to handle a website with many (should support at least 1000) subdomains, each of them served by a different FPM pool, with a different user. ...
3
votes
2answers
648 views

How To Use User Directories With Nginx With Authentication

I am using Debian based host and using Nginx and PHP-FPM, I wants to enable user directories in nginx and wants multiuser support with basic authentication also. That means when Alex open www.example....
3
votes
1answer
4k views

Where can I find a PHP-FPM RC script?

I compiled PHP on my own computer, and I want to know how to setup a script to start PHP-FPM automatically. Can anyone suggest a script that will do this for me? I'm using a Ubuntu Linux server ...
3
votes
3answers
2k views

High memory usage on the server - can't determine the process

I've noticed high memory usage on the server. Details: OS: CentOS 6.3 - x86_64 Web server: Nginx with PHP-FPM The server is generating PDF documents so the traffic is minimum. top: # top -b -n 1 -...
3
votes
2answers
8k views

What does apc.mmap_file_mask really do?

I want to use APC in a shared environment, but the main problem is of course, opcode sharing. To overcome this, I've thought about using different apc.mmap_file_mask for each user (they're chrooted ...
3
votes
3answers
6k views

APC shared memory problems

i have nginx+php-fpm and APC installed on a freebsd server, and i'm experiencing constant problems with php-fpm connected somehow with APC. php-fpm freezes in 'lockf' state (in top) and thus site is ...
3
votes
3answers
2k views

Docker - scaling nginx and php-fpm seperately

I've been playing around with docker and docker-compose and have a question. Currently my docker-compose.yml looks like this: app: image: myname/php-app volumes: - /var/www ...
3
votes
2answers
1k views

Directory for PHP 5 FPM socket files is deleted after reboot on Ubuntu Server

I've created a directory to store socket files for PHP 5 FPM: sudo mkdir /var/run/php-fpm. It is owned by root:root as well as core PHP FPM process. When PHP FPM is starting, it creates socket files ...
3
votes
2answers
5k views

Docker + nginx + Php-FPM 502 Bad Gateway

I'm trying to install php-fpm and nginx via docker and I have a problem with nginx which returns me a 502 Bad gateway error, however when I try to go on any HTML file only displays correctly. What ...
3
votes
2answers
8k views

FastCGI: comm with server … aborted: idle timeout (30 sec)

I have multiple virtual webs running Wordpress but this one started to throw errors and I am unable to find the problem. Apache says: [Tue Jul 30 14:13:40 2013] [error] [client 82.100.0.70] FastCGI: ...
3
votes
1answer
371 views

Making Nginx send 4xx/5xx errors from PHP-FPM

I have Nginx setup to reverse proxy all files ending in .php. In some scripts, I check for parameters and send "406 Not Acceptable" as a generic error which needs to be picked up on jQuery/from Ajax. ...
3
votes
1answer
93 views

cannot restart php5-fpm

I've made some changes in the .ini files and wanted to restart php5-fpm. /etc/init.d/php5-fpm restart Jan 20 14:25:48.171577 [ERROR] bind() for address '/var/lib/php5-fpm/apps.sock' failed: ...
3
votes
2answers
2k views

Securing PHP via open_basedir based on script path

I have several users running PHP scripts on a server and I'd like to lock it down so that their scripts can only access files in their www directory (it doesn't use linux user accounts, so there isn't ...
3
votes
1answer
1k views

Nginx PHP-FPM Basic Auth

I have nginx with php-fpm installed on Debian Squeeze. Directory tree is: /var/www/mysite index.php secret_folder_1 admin.php static.html secret_folder_2 admin.php static.html pictures img01....
3
votes
1answer
4k views

php-fpm getting a “failed” message, but the processes start — ok?

I'm having a strange issue where when I start php-fpm, I get the following message: > /etc/init.d/php-fpm start Starting php-fpm ................................... failed But when I look at ...
3
votes
1answer
215 views

Passing Apache variable into SetHandler directive

I'm trying to have dynamically determined Unix socket used for different separated PHP "apps" (different sockets lead to different PHP-FPM pools) on my Apache (2.4.18) server (using mod_proxy_fcgi): &...
3
votes
2answers
871 views

nginx+apache2.4+php-fpm - SERVER[“REMOTE_ADDR”] and php_admin_value

I'm trying to get server work in the way nginx->apache2.4->php-fpm(via mod_proxy_fcgid) (nginx for serving static files) (I'm not sure apache is even needed now). It works but I got few questions. ...
3
votes
1answer
1k views

What is difference of PHP handler (CGI vs FastCGI vs Mod_PHP vs suPHP )?

I understand that there are four different PHP handlers out there (AFAIK). CGI (php-cgi) FastCGI (php-fpm) Mod_PHP suPHP I need to know the pros and cons of these handler and what environments ...
3
votes
2answers
2k views

PHP-FPM signals for pool error_log rotation

I am moving all my server's log rotation tasks for logrotate. The server has several PHP-FPM pools, each of them configured with a separated error_log directive. The logrotate recipe for the logs is ...
3
votes
1answer
6k views

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 ...
3
votes
1answer
4k views

nginx & php-fpm and custom header

I would like to pass some custom header (ACCESS_TOKEN) from client RESTful application (JS) to application server (php-fpm). I had read that nginx should pass all http headers to php, but somehow it ...
3
votes
2answers
4k views

Finding Nginx/PHP-FPM bottleneck that is causing random 502 gateway errors

I work for a rather busy internet site that is often gets very large spikes of traffic. During these spikes hundreds of pages per second are requested and this produces random 502 gateway errors. Now ...
3
votes
2answers
2k views

APC Server Cache Fragmentation

I'm running a Wordpress site with APC and W3TC on CentOS 5.5 which gets around 10000 pageviews a day (including ajax and WP-Admin). The server is a low-level VPS and has a max of 376MB RAM. Recently ...
3
votes
1answer
295 views

php-fpm and nginx @ high CPU usage?

My server is with DigitalOcean with the following plan: 2 Core Processor 2 GB Memory My website is receiving thousands of visitors, however, both CPU cores are @ 100%: The issue seems to be with ...
3
votes
1answer
34 views

PHP FPM, location nesting vs unnested for avoiding code execution

Is there any advantage using: location ~ \.php { location ~ \..*/.*\.php$ { return 403; } fastcgi_pass unix:/var/run/php5-fpm....
3
votes
1answer
132 views

nginx locations and precedence (deny ignored for *.php)

I'm a somewhat experienced Apache admin in a past life, but I've decided to take the plunge and learn nginx. So far everything seems fairly intuitive, but it's clear that I haven't quite internalized ...
3
votes
2answers
9k views

403 Forbidden when trying to access a folder in document root of nginx

When I access index.php, it works fine. But on localhost/pset7, it gives a 403. Here is the permission log, -rw-r--r--. 1 root root 51 Jul 31 14:21 index.html -rw-r--r--. 1 root ...
3
votes
2answers
2k views

Apache fast-cgi and php-fpm failing to run php file?

I have been trying to switch my server from mod php to fastcgi set up on an apache server running on osx (as a development machine). My problem is that php-fpm doesn't seem to processing the files. ...
3
votes
1answer
1k views

restarting php5-fpm on ubuntu 14.04 with chef

I have this in my chef recipe: service 'php5-fpm' do supports :restart => true action [ :enable, :start ] end However my recipe now barfs in Ubuntu 14.04, as "/etc/init.d/php5-fpm restart" ...
3
votes
1answer
1k views

unable to switch off expose_php in ubuntu 14.04 with nginx and php-fpm

According to phpinfo: Loaded Configuration File: /etc/php5/fpm/php.ini # grep expose_php /etc/php5/fpm -R /etc/php5/fpm/php.ini:expose_php = Off /etc/php5/fpm/pool.d/www.conf:php_flag[...
3
votes
1answer
354 views

Save PHP opcache to Memcached

Running on small servers it would make sense offloading these as much as possible for performance. Also offloading will prevent from the server becoming a bottleneck. Therefore I use memcached for ...
3
votes
1answer
3k views

Running Moodle with nginx in userdir (slash arguments)

I am moving Moodle (moodle.org) from an Apache host to a Ubuntu 12.04 LTS host running Nginx. The way the host is set up means that it will running quite a few domains where every domain (or other ...
3
votes
1answer
3k views

How to get PHP_AUTH_USER and PHP_AUTH_PW available in nginx?

I have a Magento module that asks for $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] variables. In its documentation, the following setup for apache is proposed: SetEnvIfNoCase Authorization "...
3
votes
2answers
921 views

nginx try_files processed twice and fails if error fallback set

I have a location block setup to catch all file requests and send them to PHP-FPM: location / { try_files $uri /routing.php?$args; fastcgi_pass unix:/opt/local/var/run/php54/php-fpm-www....
3
votes
1answer
1k views

Using Zend Optimizer+ with php-fpm + nginx

Note: I am talking about a component previously in Zend Server, but is now a standalone module and open-sourced, and will be bundle with PHP 5.5, it has performance/usability edge over the more widely ...
3
votes
1answer
984 views

Segfault PHP-FPM, Nginx, Freebsd

We are experiencing CPU shortage at high-load. It only happens at some point when online users are around 1300-1400 (according google analytics). We are receiving Empty Response in browser. It seems ...
3
votes
2answers
7k views

php-fpm Bad file descriptor errors

I'm using php-fpm with customer separate pools. Sometimes page are freezing, then showing 500 internal server error, and I'm getting such errors in error log: [11-Feb-2013 22:12:39] ERROR: unable to ...
3
votes
2answers
2k views

PHP-FPM chroot with chdir

I am trying to setup a site inside of a PHP-FPM chroot. My paths are as follows: chroot = /var/www/ chdir = www/ The chroot works just fine without chdir. But when I add chdir I get this error on ...
3
votes
1answer
2k views

Why Is PHP-FPM Only Using One Process?

Looking at my PHP-FPM stats page, it looks like only one process is handling all of the connections right now. My guess is that requests are being executed so quickly, thus far, that it doesn't need ...
3
votes
1answer
2k views

How to free PHP-FPM memory?

There are several discussions complaining high memory usage of PHP-FPM, without any practical approach to overcome. As I explored the problem with numerous tests, the problem is related to the age of ...
3
votes
2answers
5k views

nginx, php-fpm, and multiple roots - how to properly try_files?

I have a server context which is rooted in a login application. The login application handles, well, logins, and then returns a redirect to "/app" on the same server if a login is successful. The ...
3
votes
2answers
2k views

Ever increasing mem usage by php-fpm?

It seems php-fpm is allocating more and more memory, although peaks and dips in amount of requests. Couldn't post more than one image, so I put them here. As you can see in the uri of the pictures, ...
3
votes
1answer
2k views

Per pool php.ini on php-fpm

Anyone have any idea how to do this in tittle ? Or at least something similar (enable/disable functions that are usualy in php.ini) My pool now looks like this [amar] listen = 127.0.0.1:11000 user =...
3
votes
2answers
72 views

ubuntu 14.04 Apache 2.4.7 mpm_event Files and FilesMatch not working

We recently switched our Apache 2.4.7 mode from mpm_pre-fork to mpm_event. Since then we haven't been able to get our Files directive to work. <Files "*.php"> Header set Cache-Control "no-...
3
votes
1answer
258 views

nginx and php-fpm “Primary script unknown”

Smells like a duplicate, I know, but I have now tried this Setup 5 Times over, and still I can't get this to work. Most of the configs are complicated with chroot and multi servers etc., but I have ...
3
votes
4answers
4k views

apache 2.4, mod_proxy_fcgi not honouring .htaccess, work around needed

I am using apache 2.4.7 with mod_proxy_fcgi for purpose of passing through php to php-fpm (this will be used for shared hosting environment). The htaccess works fine for non php files, but once it hit ...
3
votes
2answers
829 views

php5-fpm maxes out all cores (nginx+php5fpm+wordpress)

We have a 16 gig linode running with 8 cpu cores and I'm trying to debug an issue that when I try a load test that the server starts to freak out around 250 requests a second on a pretty basic ...
3
votes
3answers
4k views

NGINX + PHP-FPM + MYSQL - High CPU, Low RAM

All of a sudden our server started to act really weird, extremely high CPU usage and low RAM usage. I've never seen this before and I'm not sure what to do. I feel like if I could get the system to ...
3
votes
1answer
3k views

Can php-fpm support open_basedir set dynamically for multiple virtual hosts with a single user pool?

I am running into a problem where trying to set open_basedir dynamically under nginx (and apache) for php-fpm is "bleeding through" to other vhosts when running php-fpm as user "nobody" (for legacy ...