nginx 下 drupal 8升级提示 update.php/selection not found

问题如题所述,解决的办法是在drupal 8 伪静态文件中添加几行代码,最终完整的rewrite代码如下:

if (!-e $request_filename) {
  rewrite ^/update.php(.*)$ /update.php?q=$1 last;
  rewrite ^/(.*)$ /index.php?q=$1 last;
}

 
location ~ ^/(index|update)\.php(/|$) {
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
 
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_intercept_errors on;

}
保存后,停止并重新启动nginx服务,顺利升级。

评论

将drupal 从7.X 更新至7.Y时,需在\drupal\sites\default\settings.php文件中设置$update_free_access = TRUE;才能运行update.php.
但是实际在操作过程中$update_free_access = FALSE;update.php照样可以运行,而且在更新后update.php一样可以运行,请问如何通过参数设置才能让update.php无法访问。

dashan 答复于