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)

10
votes
4answers
16k views

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 ...
14
votes
7answers
58k views

Nginx + php-fpm “504 Gateway Time-out” error with almost zero load (on a test-server)

After debugging for 6-hours - I am giving this up :| We have a nginx+php-fpm+mysql in LAN with almost 100 wordpress (created and used by different designers/developers all working on test wordpres ...
10
votes
4answers
15k views

nginx + PHP-FPM = “permission denied” error 13 in nginx log; configuration mistake?

I've got nginx 0.7x + PHP-FPM running under PHP 5.2.10 on one RHEL5 server, but trying to duplicate that setup under the bundled-in PHP-FPM in PHP 5.3.3 on a second server, I'm having some trouble ...
4
votes
4answers
2k views

PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/gd.so' undefined symbol: gdImageWebpCtx in Unknown

We're running RHEL6 and just started getting this error when restarting php-fpm. PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/gd.so' - /usr/lib64/php/modules/gd.so: ...
7
votes
3answers
25k views

What is wrong in my php-fpm configuration?

I have a 64-bit server but only 256MB of RAM. So, I moved to nginx server with fast-cgi to connect to PHP. I have PHP 5.3.6 running. The issue is that after every two or three days when I try to ...
6
votes
1answer
10k views

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 ...
9
votes
4answers
27k views

Nginx 1 FastCGI sent in stderr: “Primary script unknown”

My first time using Nginx, but I am more than familiar with Apache and Linux. I am using an existing project and when ever I am trying to see the index.php I get a 404 File not found. Here is the ...
3
votes
2answers
2k views

Nginx ignoring client's HTTP 1.0 request and respond by HTTP 1.1

I am testing using nginx/php5-fpm, with the code <?php header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); // also tested: header("Status: 404 Not Found"); echo $_SERVER["SERVER_PROTOCOL"]; ...
2
votes
2answers
1k views

Getting rid of “Welcome to nginx!”

I've just setup nginx on my Ubuntu staging machince. Entering http://192.168.1.1./index.php works like a charm and loads the index.php file i've put in the /var/www/public_html folder. ...
1
vote
2answers
405 views

Installing php-fpm over php version missmatched

I have PHP installed by yum from the base @updates repository on Centos 6.3: php x86_64 5.3.3-14.el6_3 @updates 3.5 M I would like to install php-fpm version 5.3 because our web software works ...
1
vote
1answer
477 views

php5-fpm configuration pm - (node) Process manager settings nodes in more layman terms

I have the following configuration for php-fpm [www] listen = 127.0.0.1:9000 listen.allowed_clients = 127.0.0.1 user = www-data group = www-data pm = dynamic pm.max_children = 50 pm.start_servers = ...
1
vote
1answer
456 views

Intermittent error 404 during higher loads. (nginx/php/apc/mysql)

I have a 4 cpu core VPS with 4GB ram. It is running Ubuntu 10.04 with nginx/0.7.65, PHP 5.3.2, and MySQL. I use php5-fpm for the communication to nginx. I also have php5-apc complimenting with php ...
8
votes
1answer
5k views

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 ...
5
votes
3answers
6k views

Apache 2.4 + PHP-FPM + ProxyPassMatch

I recently installed Apache 2.4 on my local machine, together with PHP 5.4.8 using PHP-FPM. Everything went quite smoothly (after a while...) but there is still a strange error: I configured Apache ...
11
votes
5answers
14k views

Why are my PHP files downloading instead of processing with Nginx

I have seen the same problem, and many resolutions for it pointing to adding the type handler, but that was for Apache. I am using Arch Linux, Nginx, PHP and PHP-FMP and I cannot figure out why php ...
5
votes
1answer
5k views

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

Nginx + PHP-FPM = “Random” 502 Bad Gateway

I am running Nginx and proxying php requests via FastCGI to PHP-FPM for processing. I will randomly receive 502 Bad Gateway error pages - I can reproduce this issue by clicking around my PHP websites ...
3
votes
2answers
6k 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 ...
2
votes
3answers
2k views

NginX & PHP-FPM, random 502

2010/09/19 14:52:07 [error] 1419#0: *10220 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: [...], server: [...], request: "POST /[...] HTTP/1.1", ...
9
votes
3answers
31k views

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; ...
6
votes
2answers
4k views

Apache2 fcgid (not FastCGI) with PHP FPM

Apache2 has a built in fastcgi replacement, called fcgid. That's fine, but it lacks the FastCgiExternalServer directive, which I used to connect to the PHP-FPM. How can I do the same with the fcgid ...
6
votes
1answer
4k views

Working Nginx fastcgi_cache php-fpm cache and static file caching configuration?

Nginx wiki is very vague with explanation as to how to properly setup nginx with php-fpm with fastcgi_caching for sites which have cookies i.e. wordpress, drupal, vbulletin etc. I downloaded a ...
5
votes
1answer
3k views

PHP-FPM's chroot and chdir directory

I am setting up php-fpm with chrooting enabled. Now I see that there are two options, and I want to know what the exact difference is. The setup has: chroot = /var/www/domains/domain.tld/ ; Chdir to ...
2
votes
1answer
6k views

How to configure php-fpm to log logs to log files configured in nginx virtualhosts

I have Fedora 16 with nginx and php-fpm. Everything is working very good. All logs with php notice,warnig error etc. are in /var/log/php-fpm/www-error.log. Is there a way to configure php-fpm to write ...
2
votes
5answers
13k views

How do I make Nginx redirect all requests for files which do not exist to a single php file?

I have the following nginx vhost config: server { listen 80 default_server; access_log /path/to/site/dir/logs/access.log; error_log /path/to/site/dir/logs/error.log; root ...
1
vote
1answer
176 views

Set global handling for PHP scripts in NGINX + PHP-FPM

I have to define fastcgi_pass for every virtual host. How do I define it global-wise? server { listen 80; server_name www.domain.tld; location / { root ...
1
vote
1answer
12k views

How do I change the NGINX user?

I have a PHP script that creates a directory and outputs an image to the directory. This was working just fine under Apache but we recently decided to switch to NGINX to make more use of our limited ...
6
votes
4answers
5k views

Nginx + PHP 5.3.3 (with php-fpm) - memory usage?

I recently bought Xen VPS (linode.com) with Debian 5.0 Lenny (i386), 512MB RAM. At the moment I have only three small websites (built with Drupal) with about 600 users per day in total running on this ...
3
votes
2answers
2k views

PHP-Mcrypt Installation

I need to install php-mcrypt on my CentOS 5.5 VPS, When I try yum install php-mcrypt, it says that it is set to be updated which implies that it is already installed. I looked in the ...
3
votes
4answers
2k 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. ...
1
vote
1answer
3k views

nginx + php fpm -> 404 php pages - file not found

*2037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream server { listen 80; ## listen for ipv4; this line is default and implied #listen ...
1
vote
2answers
5k views

Ubuntu PHP-FPM not starting

I recently installed PHP 5.3.8 from source distribution on Ubuntu 11.04. Here's the first parts of my configure directive: ./configure --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm ...
0
votes
2answers
528 views

Can't get php-fpm with Nginx to work

Server: CentOs x86_64 /etc/php-fpm.d/webuser1.conf [webuser1] listen = 127.0.0.1:9001 listen.allowed_clients = 127.0.0.1 user = webuser1 group = webuser1 pm = dynamic pm.max_children = 15 ...
0
votes
1answer
647 views

How can I setup nginx to serve virtualhosts with rails(unicorn/passenger) and php-fpm

I would like to serve multiple sites on one instance. I install nginx, php-fpm, and a rails app. I use sites like this to guide me. I configure php-fpm to listen to a local socket listen = ...
5
votes
1answer
2k views

PHP5-FPM does not create unix socket directory within /var/run

I've set up my php5-fpm to bind to a unix domain socket within /var/run/php5-fpm. /etc/php5/fpm/pool.d/www.conf listen = /var/run/php5-fpm/$pool.sock The problem is that it will not automatically ...
3
votes
2answers
1k 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
2answers
1k 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 ...
2
votes
1answer
552 views

CakePHP and Wordpress on Nginx PHP-FPM

I'm trying to configure both CakePHP and a wordpress blog on the same server. CakePHP here: http://site.com/ Wordpress blog here: http://site.com/blog/ What works: The whole CakePHP app and going ...
2
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 ...
2
votes
3answers
5k views

Nginx + Php5-fpm not rendering php files

I've spent hours figuring out how to install Nginx + Ruby Enterprise Edition + PHP5-fpm and MYSQL, finally it is all installed and all seems to have started fine. But for some reason php files are ...
1
vote
2answers
2k views

Nginx PHP-fpm permission

When i'm setting the user in nginx.conf to root root: user root root; then my website is working, but when i set it to nginx nginx i get error in the logs: connect() to ...
1
vote
3answers
2k views

webserver horrible slow, sometimes incredible fast

i am running a small community ( 6000+ Members ) on a non-virtual 64-bit ubuntu 11.04 system. I am not a Linux-pro, not even advanced, i just tried to setup a webserver, which does nothing special ...
1
vote
0answers
5k views

NGINX + php-fpm + APC High CPU Load

I am reaching out for some help here, I have spent quite a few hours on this site searching the posts and also on google trying to see what the issue may be and trying to solve my problem without much ...
1
vote
1answer
517 views

Running php-fpm pool with root privileges?

I want one of the pools run with root privileges. Is this possible? I've tried putting user = root group = root but it didn't start. Figured it out by adding a user to /etc/sudoers file with: ALL = ...
0
votes
2answers
230 views

Trying to find bottleneck… 60k onsite visitors

I know this will be hard, but I'm willing to try the Q&A route. I have a Wordpress site that currently has 60,000 visitors on the site at once. I'm using an EC2 m3.xlarge, php/php-fpm 5.5.10, ...
0
votes
2answers
620 views

Apache 2.4 + PHP-FPM + mod_fastcgi (Problems setting up PHP-FPM)

I have been trying to get PHP-FPM to work with Apache 2.4, but mod_fastcgi does not work with 2.4. Is there any solution to this problem? I want to run it using an UNIX socket, but I cannot find any ...
0
votes
1answer
1k 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 ...
0
votes
1answer
1k views

Apache + PHP-FPM + chroot results “File not found.” error

I want to set chroot to the DocumentRoot using PHP-FPM pools' chroot attribute. With the settings below, whatever I do I get only a "File not found." error: /etc/php5/fpm/pool.d/example.conf ...
0
votes
2answers
146 views

PHP scripts time out but regular pages are snappy

I'm having a strange issue with nginx and PHP-FPM. I have a server set up to serve downloads for my website. It's not very beasty, it's only a Celeron G530 and 4GB of RAM, because of this, I'm running ...
0
votes
1answer
633 views

piping nginx and php-fpm logs to MySQL

I got a number of nginx + php-fpm application servers running under LB. I would like to centralize the logs into external mysql database. I was wondering if there is a way of achieving this ? I ...