• 解决 WordPress“Briefly unavailable for scheduled maintenance. Check back in a minute.” 正在执行例行维护,请一分钟后回来


    WordPress在升级程序、主题、插件时,都会先切换到维护模式,也就是显示 “正在执行例行维护,请一分钟后回来(Briefly unavailable for scheduled maintenance. Check back in a minute)”,如果升级顺利,也就几秒左右就恢复正常;但是如果由于网速不佳等原因导致升级中断,WordPress就会一直停留在维护模式,不论前台还是后台,都一直显示“正在执行例行维护,请一分钟后回来“。

    如何解决这个问题呢?

    1.马上通过FTP登录你的网站,删除WordPress根目录下的 .maintenance ,刷新网页即可。

    2.但是有时候你会发现,根目录根本就没有 .maintenance!倡萌最近就遇到这个问题,最初以为是隐藏了,所以使用SSH登录服务器,但是依旧没有看到,怎么办?其实有一个比较简单的办法,直接新建一个空的txt文本,上传到主机空间中,然后重命名为 .maintenance,然后你会发现 .maintenance 居然不见了!不用担心,重新刷新你的网站,是不是正常了?!

    3.如果还是不行,或者你想让它以后可以显示 .maintenance ,那就打开 /wp-admin/includes/class-wp-filesystem-direct.php

    找到下面的代码:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    	function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    		// safe mode fails with a trailing slash under certain PHP versions.
    		$path = untrailingslashit($path);
    		if ( empty($path) )
    			return false;
     
    		if ( ! $chmod )
    			$chmod = FS_CHMOD_DIR;
     
    		if ( ! @mkdir($path) )
    			return false;
    		$this->chmod($path, $chmod);
    		if ( $chown )
    			$this->chown($path, $chown);
    		if ( $chgrp )
    			$this->chgrp($path, $chgrp);
    		return true;
    	}

    将其改为:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
     // safe mode fails with a trailing slash under certain PHP versions.
     if ( ! $chmod )
     $chmod = $this->permission;
     
    if(ini_get('safe_mode') && substr($path, -1) == '/')
     {
     $path = substr($path, 0, -1);
     }
     
    if ( ! @mkdir($path) )
     return false;
     $this->chmod($path, $chmod);
     if ( $chown )
     $this->chown($path, $chown);
     if ( $chgrp )
     $this->chgrp($path, $chgrp);
     return true;
    }

    然后刷新FTP目录,是不是看到.maintenance了,删除它吧!

  • 相关阅读:
    Individual Contest #1 and Private Training #1
    2016 GDCPC 省赛总结
    HDU 4000 Fruit Ninja(树状数组)
    HDU 4009 Transfer water(最小树形图)
    HDU 5176 The Experience of Love
    HDU 2121 Ice_cream’s world II(无定根最小树形图)
    UVA 11183 Teen Girl Squad(最小树形图)
    POJ 3164 Command Network(最小树形图)
    最小树形图
    UVA 10462 Is There A Second Way Left?(次小生成树)
  • 原文地址:https://www.cnblogs.com/lsyw/p/13812382.html
Copyright © 2020-2023  润新知