修改wordpress上传临时目录解决wordpress无法安装插件包的方法
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'><strong> 解决方法</strong><br><br>
这是因为空间中的’C:\WINDOWS\TEMP’目录没有设置IIS访问权限,需要空间商为你设置目录访问权限,一般这种要求他们是不会理的,所以我们只能改变WordPress的上传临时目录。做法如下</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
首先用FTP软件在网页空间’wp-content’目录中新建一”tmp”目录,然后在wp-config.php文件中加入下面红色的部分:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
</p>
<div style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div style="margin: 0px; padding: 0px; outline: none; float: right; line-height: 25.2px; font-size: 14px;">
<span style="line-height: 25.2px; cursor: pointer;"><u>复制代码</u></span>
</div>
<p>
代码如下:</p>
</div>
<div id="phpcode3" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
/** WordPress目录的绝对路径。 */<br>
if ( !defined(‘ABSPATH’) )<br>
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);</p> <p>/** WordPress的临时目录。 */ <br>
define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/tmp’); </p> <p>/** 设置WordPress变量和包含文件。 */<br>
require_once(ABSPATH . ‘wp-settings.php’);</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
重新定义临时目录位置。</p>
頁:
[1]