WordPress For SAE 移植
因应用商店中的自带的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 ); }
改为
- $dir = ‘saestor://haokunblog/uploads’; //haokunblog是你的storage domain
- $url = ‘http://’ . $_SERVER[‘HTTP_APPNAME’] . ‘-haokunblog.stor.sinaapp.com/uploads’;
更多移植攻略可参见: