PHP "File Not Found" error on Bitnami/Nginx/Wordpress

Keywords: WordPress + NGINX + SSL - AWS - Technical issue - Other
bnsupport ID: 39593a03-30bd-0e13-643b-772a33a06caa
Description:
I’m getting “File Not Found” on wordpress home page. php-fpm is running, but PHP does not execute, I tried to create a phpinfo.php file and getting the same error there. Restarting services didn’t help.

This happened after I changed the domain name and got a new SSL cert. But I have not changed any nginx configs that would affect this.

I checked in /opt/bitnami/php/var/log folder and they only errors I’m getting is this:

WARNING: [pool www] server reached max_children setting (5), consider raising it

Any ideas what could be going on?

Here’s my bitnami support tool number

Hi @george3,

It seems your server is reaching the PHP limits and that’s why you are getting that warning message in the PHP-FPM’s log. You can modify that limit to a higher value and monitor the performance of the server

https://docs.bitnami.com/aws/apps/wordpress-pro/configuration/configure-phpfpm-processes/

Happy to help!


Was my answer helpful? Click on :heart:

Thanks, but this is not working for me.

First of all, following that documentation I fall under “option B - self contained bitnami installations”, but this file/path does not exist: /opt/bitnami/apps/apps/APPNAME/conf/pfp-fpm/pool.conf

Instead inside /opt/bitnami/php/etc I found common-dynamic.conf and common-ondemand.conf. I tried to increase the max_children from 5 to 20, but I’m still hitting the same error.

I don’t think this is the actual issue. Everything used to work fine, and then stopped working. It’s really strange.

It seems phpfastcgi.conf was causing the issue. I commented it out in /opt/bitnami/nginx/conf/bitnami/bitnami.conf, and everything started working again.

Here’s the contents of /opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf, perhaps you can tell me what’s wrong here?

    location ~ \.php$ {
    root html;
    fastcgi_read_timeout 300;
    fastcgi_pass unix:/opt/bitnami/php/var/run/www.sock;

   fastcgi_index index.php;
   fastcgi_param SCRIPT_FILENAME $request_filename;
   include fastcgi_params;
}

Hi @george3,

That information is correct, the problem is that NGINX can’t connect to PHP-FPM because it reached the limits and can’t accept new connections.

Are you sure you have 20 PHP-FPM processes now?

ps aux | grep php-fpm

If you do not have 20 processes, let’s try to edit the configuration at /opt/bitnami/php/etc/bitnami/common.conf.. Remember to restart the php-fpm service in the instance.

Yes, I’m sure I had 20. But like I said in my last comment, commenting out phpfastcgi.conf resolved the issue for me. So forgive me for saying but your latest comment feels irrelevant.

I’ve come across some similar issues by others and perhaps it could be due to the root html; here in the phpfastcgi.conf file.

Hi @george3,

I reviewed your configuration again and noticed that you were including that file in the configuration, why are you doing so? Note that the WordPress configuration file (/opt/bitnami/apps/wordpress/conf/nginx-app.conf) already has the information about how to connect to the PHP-FPM process

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_read_timeout 300;
    fastcgi_pass unix:/opt/bitnami/php/var/run/www.sock;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME $request_filename;
    include fastcgi_params;
}

@jota was there from the start, I didn’t specifically include it.

Hi @george3,

correct but it was commented and you uncommented it. Did you run into any issue before doing so?

@jota you got it backwards. It was uncommented, and I commented it out.

In other words, now it is a comment, so it’s no longer included, so it’s not causing the issue any more. Before it was not a comment. Am I making sense? I think I’ve been very clear from the very beginning.

Hi @george3,

It’s was uncommented because you uncommented it before.

$ diff /opt/bitnami/original-data/nginx/conf/bitnami/bitnami.conf /opt/bitnami/nginx/conf/bitnami/bitnami.conf
9c9,16
<
---
>
>       if ($host = staging.nexgent.com) {
>               return 301 https://$host$request_uri;
>       }
>       if ($host = staging.nexgent.com) {
>               return 301 https://$host$request_uri;
>       }
>
16c23
<        listen       443 ssl;
---
>        listen       443 ssl http2;
19,20c26,27
<        ssl_certificate      server.crt;
<        ssl_certificate_key  server.key;
---
>        ssl_certificate      /opt/bitnami/letsencrypt/certificates/staging.nexgent.com.crt;
>        ssl_certificate_key  /opt/bitnami/letsencrypt/certificates/staging.nexgent.com.key;
28c35
<        #include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";
---
>        include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";
30a38,47
>
>       location / {
>                 if ($request_uri ~* ".(eot|woff2|woff|ttf|ico|css|js|gif|jpe?g|png|svg|mp4|avi|flv|wmv|mov|ogv|m4p|m4v|3gp|pdf)$") {
>                         expires 365d;
>                         access_log off;
>                         add_header Pragma public;
>                         add_header Cache-Control "public";
>                         break;
>                 }
> }

As you can see, the file was modified and the line uncommented. I also launched a fresh instance and checked that the line is commented

bitnami@bitnami-wordpresspro-0303:~$ cat /opt/bitnami/nginx/conf/bitnami/bitnami.conf | grep phpfastcgi.conf
        #include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";
       #include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";

That’s how it should be configured, that’s the default configuration.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.