Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
2answers
3k views

How to test php-fpm configuration (PHP7.0)

I am running a webserver with Ubuntu 16 and php-fpm to process PHP requests. php-fpm has been installed via apt-get from the default Ubuntu repositories. According to this reference I should be able ...
1
vote
2answers
718 views

How to prevent apache from running PHP in given directory?

I use and need php_fpm7.0 on debian 9 (stretch) apache 2.4.25. DocumentRoot is /var/www/html and works well. Php enabled, scripts executed etc... Now I also want to serve the same arborescence as a ...
0
votes
1answer
303 views

Tell nginx to use different PHP process on random “502 Bad Gateway”

On a webserver, that usually works quite well with nginx and php-fpm (currently version 7.0.22, but this is mostly independet from the version), there are times when a 502 Bad Gateway occurs. This ...
2
votes
1answer
971 views

apache 2.4.6 not recognizing header type for css or js with php-fpm

I have migrated my wordpress site to AWS but the css is not being loaded and there are some js errors here is the site on AWS http://www.houseofsr.co.uk/ the error i see is Resource interpreted as ...
1
vote
2answers
502 views

Can't start sessions in chrooted nginx php-fpm environment in FreeBSD

I have a FreeBSD 11 machine running latest Nginx and PHP-FPM in chrooted mode. Everything worked fine, until I added start_session(); to index.php. This is when I received the following error: ...
1
vote
1answer
72 views

Problems with session data permissions, multiple UIDs on multiple PHP-FPM pools

I run an nginx server with 40 identical webapps on 40 different ports in 40 different PHP-FPM pools. Each pool is run on a separate user. My sessions.save_path in php.ini is /tmp/php_sessions. Let's ...
0
votes
0answers
76 views

Any way to stop Nginx from appending path to alias?

I have a VM running for development, in this VM I have nginx running on an internal IP (so no hostname) and as such all I can work with is locations rather than separate servers. The server itself ...
0
votes
1answer
22 views

Low req/s ratio on EC2 machine on PHP Hello World

I’m having a problem with AWS. Im using Elastic Container Service that is created as on link https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html Instance type ...
0
votes
0answers
130 views

nginx does not pass GET request to index.php

server { listen 80; server_name [here is my censored IP]; root /var/www/my_website/public; index index.php; location / { try_files $uri /index.php?$...
2
votes
1answer
2k views

How to use AddHandler in httpd 2.4 for php-fpm version change

I have the following setup for httpd 2.2 (CentOS 6) with mod_fastcgi and php-fpm: LoadModule fastcgi_module modules/mod_fastcgi.so <IfModule mod_fastcgi.c> AddHandler application/x-httpd-php71 ....
1
vote
1answer
1k views

Nginx and PHP-FPM concurrent requests from same IP

I am having trouble serving concurrent time consuming requests coming from the same IP. First request should take 6 minutes to respond (this is normal behaviour, my question is not about taking less ...
0
votes
0answers
199 views

PHP FastCGI still runs under www-data user

Ubuntu 16.04.1 Apache/2.4.18 PHP 5.6.32 I am trying to make a separate pool for each virtual host. So I created site1.config in /etc/php/5.6/fpm/pool.d: [site1] user = site1 group = site1 listen = /...
0
votes
1answer
73 views

2 of 16 cores are constantly maxing out CPU capacity - why?

I have nginx with php-fpm running on a 16 core Ubuntu 16.04 instance. The server is handling more than 10 million requests per hour. As you can see on the htop screenshot cores 6 and 7 are maxed out ...
3
votes
1answer
191 views

Making Nginx and PHP-FPM code version agnostic

This is not a question about a current problem but more of a "preventive medicine" question: I have the following code which is part of a much larger scrip I use to rise up Nginx environments on ...
1
vote
1answer
676 views

PHP slowlog empty even though PHP-FPM says it's logging

I have PHP-FPM listening on a Unix domain socket and I've configured the www pool (the only one present) with the following values: slowlog = /$pool.log.slow request_slowlog_timeout = 10s and just ...
1
vote
0answers
265 views

PHP-FPM + Apache 2.4 mod rewrite issues when .php file is in url

I'm having trouble with my mod_rewrite rules. They are working fine, except when a .php filename is passed in the URL. My rules are ignored in this case and I get a file not found error. Apache 2.4 ...
0
votes
1answer
24 views

Ubuntu 17.04 with MariaDB-10.2.11 unable to update 1 table (only) from remote php script

first let me introduce my setup 2 servers 1. for web, with apache (php7) and nginx(php7-fpm) + local mysql (ubuntu 16.10) 2. mysql MariaDB-10.2.11 server for server 1 (ubuntu 17.04) The first server ...
-1
votes
0answers
215 views

Disable nginx access_log with a try_files when $uri is matching a specify pattern?

In modern PHP framework we always use a route program to direct a request into somewhere other then index.php. Thus, all requests are landed on index.php, the nginx configuration file will like this: ...
1
vote
2answers
733 views

How to configure httpd or php-fpm service which version of php to use on Red Hat 7

I'm new to Red Hat, because of a problem described here:stackoverflow question I end up with 2 instalation of php 7.1. First I've installed rh-php71 package from Red Hat repo, because I don't have ...
1
vote
0answers
347 views

php-fpm (PHP-7.1) cannot serve content to nginx on FreeBSD

I am trying to install nginx and php-fpm following this guide on a FreeBSD 11.1 system on a raspberrypi-B+. Everything behaves as described in the guide up to point 14, which involves opening a php ...
1
vote
1answer
402 views

Get nginx location wildcard inside location block?

I am trying to set up an API where I can access API "foobar" through the URL http://my-apis.com/foobar/route. This is what I have so far: location ~ ^/foobar(/.*)$ { root /var/www/mysite/foobar/...
0
votes
1answer
821 views

Nginx rewrite URI to remove a prefix?

I have a slim application that I would like to place under a directory path on a domain. Currently I have it working fine using the default slim file provided, but I would like to put a rewrite rule. ...
1
vote
1answer
2k views

Nginx CentOS 7 PHP-FPM 7 502 Bad Gateway

I have configured Nginx, PHP-FPM 7 on CentOS 7. I am now having a 502 error. In www.conf: user and group are nginx. listen = /var/run/php-fpm.sock listen.owner = nginx listen.group = nginx listen....
1
vote
1answer
2k views

Correct web user for PHP-FPM under Nginx

I've always been accustomed to running PHP under Nginx as the www-data user, for everything: php service, cron, CLI, etc. Recently though, after reading up on firstly this article and then this ...
2
votes
0answers
478 views

Apache 2.4 + PHP-FPM + Chromelogger (how to increase HTTP header length limit?)

I have a running Apache 2.4 + PHP-FPM setup. There is one edge case though, when this setup fails - when using Chromelogger. Chromelogger is a server to client debugging tool, which sends it's data ...
0
votes
0answers
323 views

Why doesn't the query string appear in PHP-FPM status page?

I've enable the PHP-FPM status page and reconfigured nginx to display it. The website in question is a drupal website where the URL gets rewritten such that all non-existing files get their URL ...
0
votes
2answers
271 views

nginx rewrite : [emerg] unknown “0” variable

1.) Apache Rule: RewriteRule ^(.*)/(.*).htm$ /inner.php?Categories=$0&Title=$1 [L,QSA] 2.) After converting to nginx: rewrite ^/(.*)/(.*).htm$ /inner.php?Categories=$0&Title=$1 break; ...
1
vote
2answers
726 views

Missing PATH_INFO on Apache 2.4 / php5.6-fpm / proxy_fcgi

I'm using Debian 9 with PHP-FPM 7.0.26-2 & 5.6.32-1 from repository deb.sury.org. The same configuration is working fine on a Debian 8 server with PHP-FPM 5.6.30 I've copied the pool.d/user.conf ...
0
votes
2answers
2k views

Trying to confirm is php7.0-fpm is working with apache on Ubuntu 16.04

I configured php7.0-fpm to work with apache on Ubuntu 16.04 but not sure if it is correctly configured and working. As I understand, after installation and configuration, the output of php info file ...
1
vote
0answers
499 views

Varnish+Nginx+Magento almost like one request per second

I have been on the administrative side of a small magento 2 developers team. For the problem i am about to share you can ask for a demo page and check it out aswell you find the information shared ...
2
votes
2answers
202 views

running wordpress blog as directory location within nginx server configured for rails

I've been running a site on puma / rails setup under nginx. Now we have to setup wordpress under path /blog, i.e. www.mysite.com is the rails app, and www.mysite.com/blog is the wordpress blog. the ...
0
votes
2answers
466 views

Nginx reverse proxy to apache won't allow query strings in Wordpress admin

I'm running Wordpress on a DigitalOcean droplet, it was working fine with an apache server but I put it behind an Nginx reverse proxy to serve static files better. The front-end website works but I'm ...
2
votes
4answers
658 views

Does PHP cgi have its own set of .ini files that differ from PHP cli?

The server is: CentOS Linux release 7.4.1708 (Core) , 3.10.0-693.5.2.el7.x86_64 PHP 5.4.16 (cli) (built: Nov 15 2017 16:33:54) I wasn't able to get PHP SOAP to work without an error from web pages, ...
3
votes
1answer
3k views

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

NGINX and PHP-FPM 502 bad gateway

Ok so here is the situation, we currently have a server and we are now migrating to AWS. We have somehow identical configuration and we already tried to run apache benchmark so the PHP-FPM pool is ...
1
vote
1answer
256 views

Nginx + PHP FPM + MYSQL servers going down when too much traffic

We currently have some servers hosting a e-commerce platform in Digital Ocean, we tried to optimize how much we could, but was not enough, site is going down when too much traffic, like 800~1000 users....
1
vote
1answer
327 views

nginx multiple (for now two) php projects via php-fpm in subdirectories using alias

For the love of nginx, I can't wrap my head around this issue. Desired: I want two simple php projects (wordpress in the long haul) in two sub locations under one server block. Side note: These ...
0
votes
0answers
1k views

php7.0-fpm upstream timed out without any waiting

I receive such messages in nginx log. And requests with such errors terminate instantly in browser (504 response) without any long operations: 2017/11/24 09:20:53 [error] 175829#175829: *13282 ...
1
vote
1answer
3k views

Nginx With PHP FPM - Resource Temporarily Unavailable - 502 Error

Nginx With PHP FPM - Resource Temporarily Unavailable - 502 Error I am using a some code to send off just over 160 GET requests asynchronously using curl to my API which is running Nginx with Php-fpm ...
3
votes
1answer
4k views

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] ...
1
vote
1answer
686 views

php7.0-fpm emergency_restart_threshold option

I'm setting up nginx and php7.0-fpm on Ubuntu 16.0.4. I haven't used nginx and php7.0-fpm combo before so I was following a number of guides. The guides I found all recommended adding the following ...
0
votes
0answers
1k views

FastCGI sent in stderr while reading response header from upstream

I have recently installed Nginx(compiled) + PHP7-fpm + MariaDB on my VPS! And i see on all my nginx/log files this error: 2017/11/17 17:45:15 [error] 23573#23573: *7 FastCGI sent in stderr: "PHP ...
0
votes
1answer
2k views

PHP-FPM Slow Log ERROR: failed to ptrace(ATTACH) child: Operation not permitted (1)

I am running CentOS 7 with Nginx/PHP-FPM. To debug a couple of slow Wordpress and CodeIgniter requests I activated PHP-FPMs slow log feature in www-pool.conf: slowlog = /var/log/php-fpm/www-slow.log ...
0
votes
0answers
3k views

502 bad gateway error nginx connection reset by peer

I've been getting timeouts caused by a 502 bad gateway error on certain GET requests. I've tried adding these lines to my nginx site conf file: server { client_max_body_size 500M; ...
0
votes
0answers
158 views

PHP-FPM timing out and backend connection failure

I have a server with PHP7 FPM and Apache 2.4. I've set it up to running user pools. I have several PHP-FPM pools on the server. Only one is timing out and experiencing connection failures. This is ...
0
votes
1answer
262 views

Nginx: How to use a different php-fpm pool depending on url

I have a site using the standard nginx approach for directing traffic via /index.php regardless of url: location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass ...
3
votes
1answer
287 views

PHP-FPM pool user in load balancing

we know processing part is separate from database in load balancing. in processing i use php-fpm. i have to select a linux user and group in php-fpm pool. If I use root as user and group for php-...
0
votes
1answer
672 views

How to setup a different root for an Nginx location?

I'm setting up my local web dev server using NGINX and PHP-FPM on OS X. I've installed both services and set up a virtual for localhost domain. So far everything works: nginx is running correctly ...
0
votes
1answer
463 views

Fine tune Nginx & PHP FPM

I have an Ubuntu droplet with the following: 16GB RAM 8 CPUs I'm running nginx and PHP FPM, but I don't seem to be getting the most out of my server. Both my CPU usage and my memory usage are at ...
0
votes
0answers
597 views

Access PHP file outside root

This is my nginx conf: server { root /var/www/html/public; location / { rewrite ^(.*)$ /index.php last; try_files $uri $uri/ /index.php?$query_string =404; } ...