Nginx running 2 PHP versions simultaneously

Operating system: CentOS
**OS version:**7

I’m running Nginx and have PHP 5.6, 7.2 and 7.4 installed. Even though I have selected 7.4 PHP-fcgid to be the default for each domain and in Server Templates, in running processes I see that some domains are running 7.2. A few are even running 7.2 and 7.4 simultaneously.

What do I need to do so that all domains only run 7.4?

Thanks!

Should I uninstall 5.6 and 7.2? I’ve been searching all over but haven’t found any articles regarding this issue. Does anyone have any suggestions? Thanks

I’ve seen a couple of reports of this, but I can’t even imagine how it could happen.

Can you post the nginx config for this virtual host?

Hi Joe.

Thanks so much for helping me. Here’s what the config for one of the domains that are running multiple PHP versions. Please let me know your thoughts.

server {
		server_name domain.com www.domain.com;
		listen 123.456.789.000;
		root /home/domain/public_html;
		index index.html index.htm index.php;
		access_log /var/log/virtualmin/domain.com_access_log;
		error_log /var/log/virtualmin/domain.com_error_log;
		fastcgi_param GATEWAY_INTERFACE CGI/1.1;
		fastcgi_param SERVER_SOFTWARE nginx;
		fastcgi_param QUERY_STRING $query_string;
		fastcgi_param REQUEST_METHOD $request_method;
		fastcgi_param CONTENT_TYPE $content_type;
		fastcgi_param CONTENT_LENGTH $content_length;
		fastcgi_param SCRIPT_FILENAME /home/domain/public_html$fastcgi_script_name;
		fastcgi_param SCRIPT_NAME $fastcgi_script_name;
		fastcgi_param REQUEST_URI $request_uri;
		fastcgi_param DOCUMENT_URI $document_uri;
		fastcgi_param DOCUMENT_ROOT /home/domain/public_html;
		fastcgi_param SERVER_PROTOCOL $server_protocol;
		fastcgi_param REMOTE_ADDR $remote_addr;
		fastcgi_param REMOTE_PORT $remote_port;
		fastcgi_param SERVER_ADDR $server_addr;
		fastcgi_param SERVER_PORT $server_port;
		fastcgi_param SERVER_NAME $server_name;
		fastcgi_param HTTPS $https;
        client_max_body_size 200m;
		set $skip_cache 0;
 
        # ---------------------------------------------------------------------
        # CACHE SKIP RULES - START
        # ---------------------------------------------------------------------
 
        # Do not cache POST requests - they should always go to PHP
        if ($request_method = POST) {
            set $skip_cache 1;
        }
 
        # Do not cache URLs with a query string - they should always go to PHP
        if ($query_string != "") {
            set $skip_cache 1;
        }
 
 		# WooCommerce-specific cache skip rules
 		if ($request_uri ~* "/store.*|/cart.*|/my-account.*|/checkout.*|/addons.*|/shop.*") {
 			set $skip_cache 1;
			set $skip_cache_reason WP_WooCommerce;
		}
 
 		if ($cookie_woocommerce_items_in_cart) { 
 			set $skip_cache 1; 
 			set $skip_cache_reason WP_WooCommerce;
		 }
 
		if ($request_uri ~* ("/cart.*")) { 
            set $skip_cache 1; 
        }
 
        # Don't cache URIs containing the following segments (admin panel, sitemaps, feeds, etc.)
		if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
            set $skip_cache 1;
        }
 
        # Don't use the cache for logged-in users or recent commenters
        if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
            set $skip_cache 1;
        }
 
        # ---------------------------------------------------------------------
        # CACHE SKIP RULES - END
        # ---------------------------------------------------------------------
		include /home/domain/public_html/hidemywpghost.conf;
        location / {
                # This is cool because no php is touched for static content.
                # include the "?$args" part so non-default permalinks doesn't break when using query string
                try_files $uri $uri/ /index.php?$args;
        }
		location ~ \.php$ {
			try_files $uri =404;
			fastcgi_pass unix:/var/php-nginx/158817213828777.sock/socket;
			fastcgi_cache WORDPRESS;
            fastcgi_cache_valid 200 60m;
            fastcgi_cache_bypass $skip_cache;
            fastcgi_no_cache $skip_cache;
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            if (!-f $document_root$fastcgi_script_name) {
                return 404;
            }
		}
		listen 123.456.789.000:443 ssl;
		ssl_certificate /home/domain/ssl.cert;
		ssl_certificate_key /home/domain/ssl.key;
        fastcgi_read_timeout 300;
	}

Does anyone have an idea what’s happening? Thanks