Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

successdav's avatar

Configure Nginx to serve php 7.3 instead of 7.0

I have installed php 7.3 on my server and I had php 7.0 also installed to thesame server

when I run php -v it displays

	PHP 7.3.16-1+ubuntu16.04.1+deb.sury.org+1

but nginx still serves php 7.0 on my website. Here is my Nginx Configuration

  GNU nano 2.5.3                                                           File: wordpress_https.conf                                                                                                                  Modified

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                try_files $uri $uri/ /index.php?$args ;
        }


        location ~* \.(htaccess|htpasswd) {
                deny all;
        }

        location ~ \.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS on;
                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
                fastcgi_read_timeout 60s;
        }

        # set long EXPIRES header on static assets
        location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires 30d;
                access_log off;
        }


}
0 likes
0 replies

Please or to participate in this conversation.