Fix unable to run update.php on Drupal 8

Are you getting an Page not found error when attempting to run update.php?

Then I assume your sever is running nginx as the web server.

To fix update the location directive for PHP files location ~ \.php$ { with the following

location ~ '\.php$|^/update.php' {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        include fastcgi_params;
        fastcgi_param HTTP_PROXY "";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_intercept_errors on;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;

If you’re server is on PHP 7.0 or 5.6, then replace the last line, respectively. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_pass unix:/var/run/php/php5-fpm.sock;

Before restarting nginx, double-check the updated configuration is good by running:
sudo nginx -t

If you don’t get any errors then restart the nginx service.
sudo nginx -s reload

Alex Aguilar, Partner, Software Engineer

Alex Aguilar

Partner, Software Engineer