码迷,mamicode.com
首页 > 其他好文 > 详细

WordPress For SAE 移植

时间:2016-11-26 18:10:41      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:配置   ext   als   org   targe   ace   upload   修改   dir   

因应用商店中的自带的wordpress版本太旧,有需要用到官网上下载的最新版的,就要考虑移植了。

第一步 配置文件

网站根目录下,修改wp-config.php

技术分享

 

数据库连接配置

第二步 附件/图片无法上传修正   wordpress问题无法建立目录wp-content/uploads/2014/0

f ( empty($upload_path) ) {
    $dir = WP_CONTENT_DIR . ‘/uploads’;
} else {
    $dir = $upload_path;
    if ( ‘wp-content/uploads’ == $upload_path ) {
        $dir = WP_CONTENT_DIR . ‘/uploads’;
    } elseif ( 0 !== strpos($dir, ABSPATH) ) {
        // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
        $dir = path_join( ABSPATH, $dir );
    }
}
if ( !$url = get_option( ‘upload_url_path’ ) ) {
    if ( empty($upload_path) || ( ‘wp-content/uploads’ == $upload_path ) || ( $upload_path == $dir ) )
        $url = WP_CONTENT_URL . ‘/uploads’;
    else
        $url = trailingslashit( $siteurl ) . $upload_path;
}
if ( defined(‘UPLOADS’) && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    $dir = ABSPATH . UPLOADS;
    $url = trailingslashit( $siteurl ) . UPLOADS;
}
if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    if ( defined( ‘BLOGUPLOADDIR’ ) )
        $dir = untrailingslashit(BLOGUPLOADDIR);
    $url = str_replace( UPLOADS, ‘files’, $url );
}

改为

  1. $dir = ‘saestor://haokunblog/uploads’; //haokunblog是你的storage domain
  2. $url = ‘http://’ . $_SERVER[‘HTTP_APPNAME’] . ‘-haokunblog.stor.sinaapp.com/uploads’;

更多移植攻略可参见:

http://www.xiumu.org/diary/wordpress-for-sae.shtml

WordPress For SAE 移植

标签:配置   ext   als   org   targe   ace   upload   修改   dir   

原文地址:http://www.cnblogs.com/wanghaokun/p/6104581.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!