Questions tagged as ['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.
Score: 0
PHP-FPM Full Status displays wrong request URI
fr flag

A bug was opened 5 years ago regarding this issue - https://bugs.php.net/bug.php?id=72319

Has anyone been able to find a workaround?

Score: 0
parsa avatar
Php-fpm doesn't start after some changes
us flag


I'm using php-fpm 7.3 with apache on the centos 7.
I installed php and apache with directamin control panel on my server before.
I added these below configs in to the global section of php fpm in /usr/local/php73/etc/php-fpm.conf directory.

emergency_restart_threshold 10
emergency_restart_interval 1m
process_control_timeout 10s

After I add these above configs to php-fpm, it doesn't start. What is the pr ...

Score: 0
Docker - Bad Gateway when attempting to proxy nginx container to laravel php-fpm container
cn flag

I'm trying to work out whats causing a 502.

I have a simple application with two containers:

web - running nginx, with a proxy to app: fastcgi_pass app:9000;

app - running php-fpm. I'm not sure how I can pass requests from web but on app/locally if I run php artisan up I get a response of Application is already up.

I can also ping app from web apt-get update && apt-get install iputils-ping -y  ...

Score: 0
Eaten by a Grue avatar
Premature end of script headers due to response header length
us flag

My question is very similar to this unanswered question: Apache 2.4 + PHP-FPM + Chromelogger (how to increase HTTP header length limit?)

Initially I was getting:

[proxy_fcgi:error] Premature end of script headers

Then after disabling the proxy:

[cgi:error] Premature end of script headers: ea-php74

I am sending debugging data in the response headers and these errors are generated any time I send res ...

Score: 0
CrazyRabbit avatar
php_admin_value on php-fpm pools aren't working
us flag

My php-fpm pools look like this (as per https://www.php.net/manual/en/install.fpm.configuration.php#example-24 this is a very valid synthax:)

[vmtest]

prefix = /srv/users/vmtest

user  = vmtest
group = vmtest

listen       = /srv/users/vmtest/run/php-fpm.sock
listen.owner = vmtest
listen.group = www-data
listen.mode  = 660

env[PATH]   = /usr/local/bin:/usr/bin:/bin
env[TMPDIR] = /srv/users/vmtest/tm ...
Score: 0
JeremyCanfield avatar
HAProxy downloads PHP files instead of displaying in browser
ru flag

I have nginx and php-fpm running on Docker. When using the hostname of my Docker system (docker1.freekb.net), the phpinfo.php page displays in the browser, thus I know that I have nginx and php-fpm properly configured to serve PHP pages. Here is the server block in /etc/nginx/conf.d/default.conf. Requests from nginx on port 80 are forwarded onto PHP on port 9000.

server {
    listen              80 ...
Score: 0
limit memory usage for each php-fpm pool
gd flag

A php-fpm config can limit a script to certain memory usage using memory_limit key. However, it only limits per script execution. What a solution that can limit memory usage for each php-fpm pool.

Score: 0
fraxool avatar
Lots of suspicious GET requests that overload my CPU
gb flag

I have a DigitalOcean droplet that hosts a small website with pretty much no traffic. Yesterday, I received an alert that my CPU was over 95%. Normally it runs between 1% to 5%. In the "bandwidth" chart on my DigitalOcean dashboard, the outbound traffic suddenly increased by a lot as seen in this screenshot :

Outbound Traffic

Outbound traffic means that it's my server that is sending the requests  ...

Score: 0
haher avatar
Issue with VirtualHost settings in Apache2.2 leading to 503 varnish cache error
cn flag

<VirtualHost 127.0.0.1:80> ServerName staging02.cherry.com

ServerAlias www.staging02.cherry.com 



DocumentRoot /home/staging02/version/www.staging02.cherry.com
ServerAdmin webmaster@cherry.ca

SetEnv environment prod
SetEnv project staging02

UseCanonicalName Off
#CustomLog /var/log/httpd/staging02.cherry.com_log combined
#CustomLog /var/log/httpd/staging02.cherry.com-bytes_log "%{%s}t %I . ...
Score: 0
Diogo Braga avatar
Apache not sending headers to PHP over FCGI/PHP-FPM
cn flag

I have a virtual host configured to process PHP files over Proxy:FCGI, and it works fine, except that PHP is not receiving custom headers and others, like "Origin".

Here my Apache 2.4 virtual host:

<VirtualHost *:80>
    ServerName domain.localhost
    DocumentRoot "/my/host/directory/public"

    DirectoryIndex index.html index.php

    ErrorLog "/my/host/directory/logs/error.log"
    CustomLog ...
Score: 1
PHP-FPM + nginx - Pool busy and optimizing for propably bad PHP code - 502 error
br flag

I have been in situation where I am not able to get PHP-FPM work for me even under slight increase in traffic. Have been trying to trace actual cause from a while and no success so far.

It started with particular site giving 502 error, looking into PHP-fpm logs I get this :

WARNING: [pool www-userA] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 childre ...
Score: 0
G. G. avatar
PHP7.4 redis issue
be flag

I just updated php7.4-redis in ubuntu 18.04 server. After I get everywhere:

PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20190902/redis.so (/usr/lib/php/20190902/redis.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/redis.so.so (/usr/lib/php/20190902/redis.so.so: cannot open shared object file: No such file or direct ...
Score: 1
nginx slow symlink subfolder
cn flag

I have two domains, like this:

  1. www.main.com in /var/www/www.main.com (without /public)
  2. system.main.com in /var/www/system.main.com (with /public)

In the first one I have a subfolder www.main.com/sub that sym-links to the second domain.

/var/www/www.main.com/sub => /var/www/system.main.com/public

To make PHP (FPM) work in the /sub I used this config:

    location /sub {
            try_files /sub/ ...
Score: 0
haher avatar
Apache not running despite same configuration due to php-fpm
cn flag

Ok, so I checked the Apache configs on the server where I can get websites running and the configs on the website where varnish keeps returning 503 and 500 and I found they were the same. The only difference is php-fpm, but I can't think of the reason why that would be the case.

[root@webdev01 ~]# sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address        ...
Score: 0
haher avatar
Varnish returning 503 and 500 errors without Apache or php-fpm showing any error that could explain it
cn flag

Increased varnish log and increased Apache logs and found:

[Thu Oct 28 10:54:02 2021] [notice] caught SIGTERM, shutting down
[Thu Oct 28 10:54:02 2021] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Oct 28 10:54:02 2021] [notice] Digest: generating secret for digest authentication ...
[Thu Oct 28 10:54:02 2021] [notice] Digest: done
[Thu Oct 28 10:54:02 2021] [debug] util_ldap.c ...
Score: 0
AtomX avatar
Unable to find php8.0-fpm.sock in /run/php/php8.0-fpm.sock, Nginx Web Server
fr flag

I'm currently listening for TCP sockets in my Nginx Web Server, but for some reasons I'd like to listen to my UNIX-domain sockets. The issue is I'm unable to find php8.0-fpm.sock in both /var/run/php/php8.0-fpm.sock and /run/php/php8.0-fpm.sock paths. When I run ls /run/php, it shows only php8.0-fpm.pid.

systemctl status php8.0-fpm confirms that it is installed and running correctly:

php8.0-fpm.service  ...
Score: 0
astaga avatar
change fastcgi directory in nginx configuration
cn flag

i am not sure how to write the proper title
i have 5 ajax requests that gonna execute postgresql query in php

here is the directory

/var/www/webgis.com:
1. webgis.html
2. php(directory)
    -query1.php
    -query2.php
    -query3.php
    -query4.php
    -query5.php
3.etc

the all previous ajax url is url: "php/query(N).php", i want to change it intourl: "query(N).php" without change my server  ...

Score: 0
PHP 7.4 under nginx with php-fpm - single shared APCu cache - how?
cn flag
C C

I have a PHP 7.4 set of scripts running with APCu extension, which is used by the code as a general object store for all users who visit the single hosted website. Due to my own lack of understanding, I later found out that the APCu cache is established per PHP process. So what I am seeing is that in some cases user 'a' is getting a different cached value than user 'b' (presumably since PHP-FPM has f ...

Score: 0
Nextcloud: Failed to open stream: Permission denied
gb flag

I'm installing Nextcloud on a FreeBSD system and I'm using lighttpd behind a nginx reverse proxy with terminal SSL.

lighttpd is able to serve static html files and can serve index.php, but without any styles, just the text.

When running lighttpd -D -f /usr/local/etc/lighttpd/lighttpd.conf and accessing cloud2.myhostname.com there's a bunch of errors as shown below.

The document root and all descendant ...

Score: 0
how to configure nginx context for fastcgi_pass
cn flag

I have config

location ~ ^/(index)\.php(/|$) {
    disable_symlinks off;
    fastcgi_pass php-fpm.my_net:9000;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_index index.php;

I see app in localhost/

I need to see it in localhost/prefix/

how to do it ?

i try

location ~ ^/prefix/(index)\.php(/|$) {

but not work

here is nginx -t

 nginx -T
nginx: the configuration file /etc/nginx/nginx.con ...
Score: 0
Apache Header set missing in server response when php-fpm is active, shown when php-fpm is inactive
us flag

Problem: When php-fpm is enabled, cors headers set in .htaccess are not shown in response. When php-fpm is disabled, cors headers are shown in the response.

Current setup:

Server:

  • Ubuntu 20.04 on Aliyun cloud (Shanghai region)
  • Apache 2.4, headers module enabled
  • php 7.4 with php7.4-fpm enabled.

In .htaccess I've set:

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Contr ...
Score: 0
mahen3d avatar
Could not execute: /usr/sbin/sendmail fails to send emails via PHP
cn flag

I have a strange error in my Centos 7.9 Server running with Postfix as the Sendmailer program, It has a Website running in PHP-7.4

I get the below error Once in a while (not everyday but weekly or so)

Could not execute: /usr/sbin/sendmail

To fix the issue all i have to do is to restart the php-fpm service,

 service php-fpm restart

Does anyone has any idea on why this is happening? And any known fixes t ...

Score: 0
"upstream sent too big header while reading response header from upstream" error - Increasing buffers not working
ng flag

I've set up the Bitnami Nginx Open Source Stack at AWS. I've started creating an application using auth0 as my authentication service. After successful login, the code must be exchanged for an access token. This is done using $auth0->exchange($url_with_params);

However, this gives me the following error:

    2021/10/10 17:38:36 [error] 14305#14305: *9 upstream sent too big header while reading r ...
Score: 0
nginx + php-fpm give me too big error log
ru flag

I use nginx and php-fpm to deploy many wordpress in one service (centos). I have turn off log_errors in /etc/php.ini, but i still get a lot of error log.

enter image description here

enter image description here

Score: 4
c0dehunter avatar
PHP scripts suddenly load very slow on Apache
jp flag

I am testing why sometimes my PHP scripts takes long to load over network (>30sec) on my Apache 2.4 Ubuntu server with PHP-FPM 7.4 using mpm_event. The server was working normally in the past few months, this started happening a few days ago and I didn't change anything. I did a reboot, it didn't help.

I've made a simple test.php. Sometimes it loads normally (<100ms), but sometimes it takes 1 minu ...

Score: 0
Rob avatar
Slow server performance [nginx + php+fpm + mariadb]
co flag
Rob

I'm having problems finding a bottleneck of my slow server performance. Single wordpress site (10-40 online users) with fastcgi caching and full HTML cloudflare caching. Site performance is fine for visitors because of caching, logged in users are facing 1-10s page load times. Query monitor is used for debugging. Site was running way better on 1 core, 2gb ram machine. No idea what is causing this. Any h ...

Score: 0
How could I run PHP-FPM master process as non-root user?
mx flag

I'm trying to achieve rootless PHP-FPM pod running in Kubernetes.

I tried simply running process in Kubernetes pod via init script that does php-fpm -FO as www-data user but it complaints about not having permissions to access /dev/stderr (log output location). Adding www-data user to the tty group also didn't help.

I tried specifying another location like /proc/self/fd/2 and even /dev/pts/1 as log  ...

Score: 0
Rouissi Iheb avatar
How to run a php application on a subdomain , and another nodejs application on another subdomain on the same nginx server?
ng flag

I hav a domain exemple.com , i need to run a php application on php.exemple.com and nodejs application on nodejs.exemple.com using nginx on ubuntu 20.

the nodejs application is already running on reverse proxy ,so i need to add the php app. What should i install for php ?

I did work on php for a while but that was on windows so trying to install php-fpm on the production server looks dangerous if you do ...

Score: 0
How to query linux kernel which storage-related operations are currently being run on the level of FS / block layer / SATA controller?
cn flag

Every once in a while, our Linux LAMP server (using PHP-FPM, XFS on thin LVM on HW RAID, Centos8) becomes inaccessible and stops responding to HTTP(S) requests.

Via centralized logging we found out that in those cases, load average quickly shoots up to hundreds, while more and more processes (systemd-journald, php processes, kernel xfs/dm threads...) get into a D state. According to iostat and pi ...

Score: 0
codeneuss avatar
Nginx + PHP-FPM starts crashing after suspicious pentesting request with hexadecimal http verb/method
tr flag

my server crashes everytime an annoying pentester tries to find security-holes in my application. I see this in the errorlog:

17:48:48 +0200] "\x16\x03\x01\x00M\x01\x00\x00I\x03\x03\xDBJA\xC5\xB17\xF6\xDA \xD4\xEEEg0\xE0\xF2\xF2\xC9S\xE4\xF9v}\x1E\x00\xC8\xC3d\x 80h;= \x1F\xD2\xAF?\x88\x8A\xA2\xCF\x16G\x99\x1D\x91" 400 173 "-" "-"

The server is configured like a normal nginx + php-fpm server. Por ...