最近有些朋友和我说,wordpress的后台在本地打开都超慢。不知道为什么,负载什么的都没有。
膘叔的简单人生
最近有些朋友和我说,wordpress的后台在本地打开都超慢。不知道为什么,负载什么的都没有。
yii的urlmanager可以让项目在访问的时候隐藏index.php,也可以以更优雅的urlrewrite方式来显示,但这一切需要一些配置,在apache上的配置上就相对比较简单,直接参考wordpress的官方配置就完了,但其实很久以来,一直都没有人写过nginx下的配置。大家都是在根据wordpress配置来更改的,比如lnmp项目中,就是:
location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
不过,这两天在看官方guide的文档,原来这些问题,官方已经提供方案了:http://yii.neatcn.com/doc/guide/1.1/en/quickstart.apache-nginx-config#nginx
Yii is ready to work with a default Apache web server configuration. The .htaccess files in Yii framework and application folders restrict access to the restricted resources. To hide the bootstrap file (usually index.php) in your URLs you can add mod_rewrite instructons to the .htaccess file in your document root or to the virtual host configuration:
RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward it to index.php RewriteRule . index.php
You can use Yii with Nginx and PHP with FPM SAPI. Here is a sample host configuration. It defines the bootstrap file and makes yii catch all requests to unexisting files, which allows us to have nice-looking URLs.
server { set $host_path "/www/mysite"; access_log /www/mysite/log/access.log main; server_name mysite; root $host_path/htdocs; set $yii_bootstrap "index.php"; charset utf-8; location / { index index.html $yii_bootstrap; try_files $uri $uri/ $yii_bootstrap?$args; } location ~ ^/(protected|framework|themes/\w+/views) { deny all; } #avoid processing of calls to unexisting static files by yii location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { try_files $uri =404; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php { fastcgi_split_path_info ^(.+\.php)(.*)$; #let yii catch the calls to unexising PHP files set $fsn /$yii_bootstrap; if (-f $document_root$fastcgi_script_name){ set $fsn $fastcgi_script_name; } fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fsn; #PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fsn; } location ~ /\.ht { deny all; } }
Using this configuration you can set cgi.fix_pathinfo=0 in php.ini to avoid many unnesessary system stat() calls.
这是一篇很小的例子,事实上网上这些例子是超多的,不过由于我是要模拟metaweblog或者是wordpress的一些操作,那我就必须要先了解很多相关的背景。
不过这里只是模拟一些发布和读取的接口,稍作了解即可。
原文来自:用XML-RPC协议读写WordPress上的文章我这里只简要的摘取一部分。
WordPress提供了XML-RPC接口使得第三方的博客写作软件(如windows live writer等)可以与之通信来发布和修改博客。我们也可以在网站上使用这个接口做一些工作,例如:在网站首页显示最新的博客、在博客之外的页面上发表博 客文章、把博客与其他内容管理系统结合,等等。
一、开启XML-RPC支持
XML-RPC协议默认是未开启的,需要到WordPress管理后台的“设置–>撰写”里的“远程发布”给XML-RPC打上勾。其说明文 字为:启用 WordPress,Movable Type,MetaWeblog和Blogger 的 XML-RPC发布协议。
二、获取接口的信息
我们查看博客首页的源代码,在head中可以发现类似这样的link项
<link title="RSD" rel="EditURI" type="application/rsd+xml" href="http://blog.bluesky.cn/xmlrpc.php?rsd" />
其中的"RSD"是“Really Simple Discovery”的意思,也就是说这是一个“简单的发现博客编辑接口”的地址。我们用浏览器直接访问这个地址就可以在其返回XML中获知博客的 ID(blogID,一般这个的值是“1”)以及它所支持的接口类型和接口地址。
三、API接口选择
WordPress提供了对Blogger API、metaWeblog API、Movable Type API以及其自身的WordPress API的支持。其中WordPress API最为丰富,提供了包括操作评论文章在内的各种各样的支持。Blogger API功能较少,基本上淘汰不用了;而metaWeblog API提供了常用的接口且参数比较简洁,用得较多一些。
四、例子代码
以下是使用Incutio的XML-RPC库和Blogger API发布文章的例子,其中IXR库也是Wordpress自身所用的库,可以在“wp-includes/class-IXR.php”找到。
<?php
$xmlrpcurl='http://blog.bluesky.cn/xmlrpc.php';
$blogid='1';
$username='admin';
$password='pass';
$postTitle='标题';
$postContent='正文内容';
require('class-IXR.php'); // /wordpress/wp-includes/class-IXR.php
$client = new IXR_Client($xmlrpcurl);
$params=array(
'',
'blog_ID'=>$blogid,
'user_login'=>$username,
'user_pass'=>$password,
'post_content'=>'' . $postContent,
'publish'=>true
);
$params=array_values($params);
$client->query("blogger.newPost",$params);
$response=$client->getResponse();
if ($response['faultCode']==0){
print 'Success';
} else {
print 'Fail:' . $response['faultString'];
}
?>
以下是用XML-RPC for PHP库和metaWeblog接口发布文章的例子。要先下载phpxmlrpc库取出其中的xmlrpc.inc来用。
<?php
include("xmlrpc.inc"); // 这里要改成xmlrpc.inc所在的路径
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
define ('DOMAIN', 'blog.bluesky.cn'); // 博客的域名
define ('BLOGID', 1); // 博客ID,一般为1
define ('USER', 'admin'); // 博客登录的用户名
define ('PASSWORD', 'pass'); // 博客登录的密码
// 创建 xml-rpc client
$cl = new xmlrpc_client ( "/xmlrpc.php", DOMAIN, 80);
// 准备请求
$req = new xmlrpcmsg('metaWeblog.newPost');
// 逐个列出请求的参数:
$req->addParam ( new xmlrpcval ( BLOGID, 'int')); // 博客ID
$req->addParam ( new xmlrpcval ( USER, 'string' )); // 用户名
$req->addParam ( new xmlrpcval ( PASSWORD, 'string' )); // 密码
$struct = new xmlrpcval (
array (
"title" => new xmlrpcval ( '标题', 'string' ), // 标题
"description" => new xmlrpcval ( '正文内容', 'string'), // 内容
), "struct"
);
$req->addParam ( $struct );
$req->addParam ( new xmlrpcval (1, 'int')); // 立即发布
// 发送请求
$ans = $cl->send($req);
var_dump ( $ans );
?>
注意一定要加上:$GLOBALS['xmlrpc_internalencoding'] = ‘UTF-8′;这一句,否则不能正确处理中文。 另一段也是用phpxmlrpc库和metaWeblog接口发表文章的例子代码,该代码使用了返回类型为“phpvals”,这样可以直接用返回结果 的$r->val来获取文章ID号。
<?php
include("xmlrpc.inc");
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
$c = new xmlrpc_client("/xmlrpc.php", "blog.bluesky.cn", 80);
$content['title']="标题"; //标题
$content['description']="正文内容"; //内容
$content['mt_keywords']="标签1,标签2"; //标签
$content['wp_password']=""; //文章密码,输入后显示加密
$content['categories'] = array("分类1","分类2"); //分类名
$x = new xmlrpcmsg("metaWeblog.newPost",
array(php_xmlrpc_encode("1"), //BLOG ID
php_xmlrpc_encode("admin"), //用户名
php_xmlrpc_encode("pass"), //密码
php_xmlrpc_encode($content),
php_xmlrpc_encode("1"))); //立即发表
$c->return_type = 'phpvals';
$r =$c->send($x);
if ($r->errno=="0")
echo "发表成功,文章序号为:".$r->val;
else {
echo "出错了";
print_r($r);
}
?>
以下是读取最新一篇文章的例子代码:
<?php
include("xmlrpc.inc");
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
$c = new xmlrpc_client("/xmlrpc.php", "blog.bluesky.cn", 80);
$msg = new xmlrpcmsg('metaWeblog.getRecentPosts',
array(php_xmlrpc_encode("1"),
php_xmlrpc_encode("admin"),
php_xmlrpc_encode("pass"),
php_xmlrpc_encode("1")) );
$res = $c->send($msg);
$val = $res->value();
$val->arraymem(0)->structreset();
while (list($key, $v) = $val->arraymem(0)->structeach())
{
echo "Element: $key; Type: ".$v->kindOf()."; Value:".$v->scalarval()."\n";
}
?>
原文地址:http://blog.bluesky.cn/archives/466/using-xml-rpc-protocol-to-read-and-write-articles-on-wordpress.html
来自xmlrpc网站的资料:http://www.xmlrpc.com/metaWeblogApi
关于这些api还有一些背景资料在这里的:http://www.xmlrpc.com/stories/storyReader$2509,多看看啦。。。
Document status
This document was updated on 8/8/03, to incorporate all the RFCs related to the MetaWeblog API. The earlier version of the document is archived here. It has been reviewed by members of the MetaWeblog API mail list, and feedback has been incorporated.
On 8/24/03, I posted a last call for comments, and received several and incorporated some.
As of 8/26/03, this document is deployable. There may be changes, but they will be clearly documented, and will only clarify the spec, in no way will they change the format or protocol. It is now safe to deploy applications based on this spec.
What is the MetaWeblog API? ![]()
The MetaWeblog API (MWA) is a programming interface that allows external programs to get and set the text and attributes of weblog posts. It builds on the popular XML-RPC communication protocol, with implementations available in many popular programming environments.
Relationship between MetaWeblog API and the Blogger API ![]()
The MetaWeblog API is designed to enhance the Blogger API, which was limited in that it could only get and set the text of weblog posts. By the time MWA was introduced, in spring 2002, many weblog tools had more data stored with each post, and without an API that understood the extra data, content creation and editing tools could not access the data.
At the time of this writing, summer 2003, most popular weblog tools and editors support both the Blogger API and the MetaWeblog API.
Relationship between MetaWeblog API and RSS 2.0
The MetaWeblog API uses an XML-RPC struct to represent a weblog post. Rather than invent a new vocabulary for the metadata of a weblog post, we use the vocabulary for an item in RSS 2.0. So you can refer to a post's title, link and description; or its author, comments, enclosure, guid, etc using the already-familiar names given to those elements in RSS 2.0. Further since RSS 2.0 is extensible, so is the MetaWeblog API. We have designed conventions for representing attributes and namespaces in MWA.
Basic entry-points
There are three basic entry-points in the API:
metaWeblog.newPost (blogid, username, password, struct, publish) returns string
metaWeblog.editPost (postid, username, password, struct, publish) returns true
metaWeblog.getPost (postid, username, password) returns struct
The blogid, username, password and publish params are as in the Blogger API. newPost returns a string representation of the post id, again as defined by the Blogger API. The struct is where the juice is.
The struct ![]()
In newPost and editPost, content is not a string, as it is in the Blogger API, it's a struct. The defined members of struct are the elements of <item> in RSS 2.0, providing a rich variety of item-level metadata, with well-understood applications.
The three basic elements are title, link and description. For blogging tools that don't support titles and links, the description element holds what the Blogger API refers to as "content."
Where an element has attributes, for example, enclosure, pass a struct with sub-elements whose names match the names of the attributes according to the RSS 2.0 spec, url, length and type.
For the source element, pass a struct with sub-elements, url and name.
For categories, pass an array of strings of names of categories that the post belongs to, named categories. On the server side, it's not an error if the category doesn't exist, only record categories for ones that do exist.
In getPost, the returned value is a struct, as with the Blogger API, but it contains extra elements corresponding to the struct passed to newPost and editPost.
The server must ignore all elements that it doesn't understand.
In a call to metaWeblog.newPost or metaWeblog.editPost, if the struct contains a boolean named flNotOnHomePage, then the post does not appear on the home page, and only appears on the specified category pages.
Request and response
Here's an example of a request and a response.
Here's the post that this request is getting info about.
metaWeblog.newMediaObject
metaWeblog.newMediaObject (blogid, username, password, struct) returns struct
The blogid, username and password params are as in the Blogger API.
The struct must contain at least three elements, name, type and bits.
name is a string, it may be used to determine the name of the file that stores the object, or to display it in a list of objects. It determines how the weblog refers to the object. If the name is the same as an existing object stored in the weblog, it may replace the existing object.
type is a string, it indicates the type of the object, it's a standard MIME type, like audio/mpeg or image/jpeg or video/quicktime.
bits is a base64-encoded binary value containing the content of the object.
The struct may contain other elements, which may or may not be stored by the content management system.
If newMediaObject fails, it throws an error. If it succeeds, it returns a struct, which must contain at least one element, url, which is the url through which the object can be accessed. It must be either an FTP or HTTP url.
metaWeblog.getCategories ![]()
metaWeblog.getCategories (blogid, username, password) returns struct
The struct returned contains one struct for each category, containing the following elements: description, htmlUrl and rssUrl.
This entry-point allows editing tools to offer category-routing as a feature.
metaWeblog.getRecentPosts
metaWeblog.getRecentPosts (blogid, username, password, numberOfPosts) returns array of structs
Each struct represents a recent weblog post, containing the same information that a call to metaWeblog.getPost would return.
If numberOfPosts is 1, you get the most recent post. If it's 2 you also get the second most recent post, as the second array element. If numberOfPosts is greater than the number of posts in the weblog you get all the posts in the weblog.
Transmitting elements with attributes ![]()
The members of the struct passed in newPost and editPost come from the elements of items in RSS 2.0. The most commonly used core elements have no attributes, so it's clear how to include them in the struct. However, some elements, such as source, enclosure and category, may have attributes and a value. Here are a simple set of rules for elements that have attributes and a value. Note that these rules do not apply to enclosure and source, which are provided for specifically above.
1. If an element has attributes, then represent the element with a struct, and include the attributes as sub-elements of the struct.
2. If an element has both attributes and a value, make the element a struct, include the attributes as sub-elements, and create a sub-element for the value with the name _value. Note that this means that no element can be passed through the API that has an attribute whose name is _value.
Transmitting elements from namespaces
RSS 2.0 allows for the use of namespaces. If you wish to transmit an element that is part of a namespace include a sub-struct in the struct passed to newPost and editPost whose name is the URL that specifies the namespace. The sub-element(s) of the struct are the value(s) from the namespace that you wish to transmit.
Comments ![]()
The Blogger API provides a parameter called appkey that allows vendors to assign a key to developers so they can track and possibly limit usage of the API for certain tools. The MetaWeblog API doesn't specifically provide a parameter for an appkey. Applications that wish to transmit an appkey should add an element to the struct called appkey and set its value to the appkey that should be associated with the call.
Applications should use the fault-response scheme defined by XML-RPC. For example, trying to create, get, or edit a post without a valid username-password should generate a fault. Client applications should display the error string, as appropriate, to the user, for example, in a dialog, or in a server log.
Thanks
Thanks to Michael Bernstein for help editing this spec in summer 2003.
References
RSS 2.0; Dave Winer; 9/02.
RFC: MetaWeblog API; Dave Winer; 3/02.
Blogger API; Evan Williams; 8/01.
ManilaRPC; Andre Radke, Brent Simmons, Dave Winer; 1999.
XML-RPC; Dave Winer; 1998
没有什么好说的,学习一下这些资料。然后折腾中。
想用word发布博客,这些就必须要看。
原文来自:http://m2009.org/?p=998
WordPress支持四种远程发布协议,他们是 WordPress,Movable Type,MetaWeblog和Blogger 的 XML-RPC发布协议。
WordPress发布协议
WordPress 发布协议值wordpress自己的文章发布协议,他的接口最为丰富,提供了包括操作评论文章在内的各种各样的支持
WordPress发布协议文档:http://codex.wordpress.org/XML-RPC_wp
Movable Type发布协议
Movable Type,简称MT,是由位于美国加州的Six Apart公司推出的网志(blog)发布系统。它是全球最受欢迎的网志系统之一,包含多用户,评论,引用(TrackBack),主题等功能,并广泛的支持各种第三方插件。
Movable Type不仅可以应用于个人的网志系统,而且可以应用于商业、教育等领域。Movable Type于2007年12月12日正式宣布以GPLv2的协议开源。
Movable Type发布协议文档:http://www.movabletype.org/documentation/
Movable Type 文件集: http://mtbook.org/
MetaWeblog发布协议
The MetaWeblog API is an application programming interface created by software developer Dave Winer that enables weblog entries to be written, edited, and deleted using web services.
The API is implemented as an XML-RPC web service with three methods whose names describe their function: metaweblog.newPost(), metaweblog.getPost() and metaweblog.editPost(). These methods take arguments that specify the blog author’s username and password along with information related to an individual weblog entry.
The impetus for the creation of the API in 2002 was perceived limitations of the Blogger API, which serves the same purpose. Another weblog publishing API, the Atom Publishing Protocol became an IETF Internet standard (RFC 5023) in October 2007.
Many blog software applications and content mangement systems support the MetaWeblog API, as do numerous desktop clients.
MetaWeblog文档:http://www.xmlrpc.com/metaWeblogApi
Blogger发布协议
The Blogger Data API allows client applications to view and update Blogger content in the form of Google Data API feeds.
文档(墙外):http://www.blogger.com/developers/api/1_docs/
google:http://code.google.com/intl/zh-CN/apis/blogger/
比较详细的api文档
API参考文档:http://www.sixapart.com/developers/xmlrpc/
webmatrix,这是微软的又一个重磅炸弹?微软,你究竟想干嘛 ?
Microsoft Web 平台不仅仅是一组功能强大的工具、服务器和技术,它还为网站、服务和应用程序的构建和托管提供了一个完整的生态系统。 无论您是要在网络上树立您公司的形象还是推出下一个 MySpace,我们都有让您走向成功的产品。 Microsoft Web 平台深受世界五百强公司信任,数以百万计的个人都在使用该平台,它一定能够适合您的需要。
看到上面的说明,或许你还没有过份在意,那么,下面这一小段的内容呢?
WebMatrix 是微软最新的 Web 开发工具,它包含了构建网站所需要的一切元素。您可以从开源 Web 项目或者内置的 Web 模板开始,也可以直接从无到有编写代码。简单并且完全是免费的。开发网站从来没有如此简单。为了开始建立网站,您只需要使用 Microsoft Web 平台安装器下载并安装 WebMatrix。这只会占用您短短的5分钟时间。当 WebMatrix 成功安装后,您可以非常方便地获得并下载最新版本的免费 Web 应用,如 WordPress, Joomla!, DotNetNuke 和 Orchard.您会发现 WebMatrix 在一个统一界面中提供了您需要的一切工具的特性,不需要再花费精力于在多种应用工具切换来完成一般性的 Web 开发任务。通过 WebMatrix,您只需要一步点击,即可编辑文件,管理数据库和更改服务器设置等。
看到上面这段呢,你怎么想?PHP/.net都在一起了,这样是否真的完美我不知道,但是这种免配置的功能是否会让网站又会铺天盖地的出来呢?
不过,说实话,我真不担心,要知道,国内还有一个大坎,那就是备案。黑黑,任你想法再多,备案都会卡死你。
更多介绍还是看官方吧:http://www.microsoft.com/web/webmatrix/,如果英文不好,可以切换成中文的。
昨天,把我的http://neatcn.com迁移到了VPS上(准备过两天,这个站也迁走),迁移过去后用Firefox访问白屏,一直不清楚是什么原因。
后来用IE访问,显示服务器500错误,心里就纳闷了,因为前两天我说过我迁移了ucapi.com,里面也有一个wordpress,那个是正常的,于是我怀疑是.htaccess文件的问题。然后把ucapi.com/wiki/目录下的.htaccess文件CP到了http://neatcn.com的根目录下,结果问题依旧(firefox显示白屏,但如果使用FireBug看,是可以看到显示500错误的。)
心里想着.htaccess文件可能有问题,因为ucapi.com下的.htaccess文件不是在根目录下,那文件里应该是带路径的。把路径去掉后,问题依旧。
然后,把.htaccess文件删除,可是问题仍然存在。
最后没办法,google一下,发现网上说的很多都是指.htaccess文件(还有人说是插件或者皮肤不兼容,我也尝试了删除所有插件和皮肤,结果还是不正常)。这个。。。我就没办法了,于是想到一个最喷血的办法。把wp-config.php备份,原文件删除,进行重装。
安装到最后一步,说是无法生成wp-config.php,让我把内容COPY到原来的wp-config.php文件中,OK,COPY完毕,结果继续安装的时候又显示500错误了,这个时候我就真的不知道做什么了。然后检查一下wp-config.php,突然发现,他与我原来的wp-config.php相比多了一点内容,那就是define("WP_DEBUG",false);,这个玩意看来是从3.0开始才开放的吧?我的博客是从2.x升级上去的,所以没有这个定义。
既然有debug功能,那就打开喽,定义WP_DEBUG为true,继续运行,这时候才发现原来我有一个文件不存在,报了fatal error,然后根据出错提示信息,从本地的wordpress程序中将缺少的文件COPY过去。如此做了大约三次,终于顺利的打开后台界面,兴冲冲的登录进去,选择更新系统,以防还有文件不存在的情况发生。
更新系统的时候,出现了好久不见的FTP用户密码框,这个在以前其实有介绍过Wordpress自动升级和plugin插件更新的问题,但这次我不想这么解决,于是我直接进入命令行,把我的目录的权限改成apache用户,就Over了。
最后,忙到凌晨2点多,http://neatcn.com终于可以正常访问。比较欣慰的在微勃上说了一下,结果被人鄙视说网站速度太慢。。唉,VPS嘛,将就点了。
rewrite规则说白了,其实并不难,只要你了解了正则规范后,你就会发现,其实,写这东西,比写PHP的正则要容易的多。毕竟PHP的正则你要考虑很多东西。而用在URL上的,不可能太多。
下面的这篇文章是08年的,不过仍然可以作为参考。以前的uchome下面,好象也是支持三级域名的。也可以参考一下官方的配置,但。。。好象是找不到官方的rewrite规则?
二级域名。如果你真的不会设置,手头又没有啥资料,你可以安装一下wordpress多用户版,安装完毕后生成的.htaccess文件,你就可以拿来作为参考了。
前提
首先得把域名绑定绑定了,比如把dev.ccvita.com解析到211.136.108.190这个IP
其次是在网站管理面板里,为网站绑定dev.ccvita.com
最后编辑配置.htaccess文件,就可以了。如果没有开启.htaccess请访问下面的内容,《Apache之AllowOverride参数详解》:http://www.ccvita.com/281.html
.htaccess文件内容
RewriteEngine on
# 把 ccvita.com 改为你要绑定的域名.
RewriteCond %{HTTP_HOST} ^(www.)?ccvita.com$
# 把 subfolder 改为要绑定的目录.
RewriteCond %{REQUEST_URI} !^/subfolder/
# 不要改以下两行.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 把 dev 改为要绑定的目录.
RewriteRule ^(.*)$ /dev/$1
# 把 ccvita.com 改为你要绑定的域名
# 把 dev 改为要绑定的目录.
# dev/ 后面是首页文件index.php, index.html
RewriteCond %{HTTP_HOST} ^(www.)?ccvita.com$
RewriteRule ^(/)?$ dev/index.php [L]
文中所涉及的域名,我没有更改过哦。原文来自:http://www.ccvita.com/362.html。
同样,如果你是typecho,如果你在后台打开rewrite规则后,你也可以参考一下(不过,这个只适合单用户,哪天要是typecho开发多用户版,估计现在这个.htaccess也是可以被拿来使用的,谁知道呢?)
自从评论里有人推荐typecho后,自己也下载了看了一下。确实,代码很漂亮,最关键的是注释是中文的。这点很让人心情愉快。虽然wordpress的英文注释也很容易懂,但毕竟不是自己的语言,总有点心里障碍。
前天晚上下载了一份看看,昨天在参考官方的一些插件的同时,自己临摹了两个。一个是搜索引擎来源关键字高亮,一个就是微博上有朋友提出的内容分页。
东西嘛。都扔在http://neatstudio.com/typecho/上面。还没有正式完成,只能算是一个测试版吧。
下面就是一些心得,希望可以给其他开发人员带来一点帮助,当然我这个只是看了一天的心得,与其他人员的相比应该是差很多了。但分享总比藏着好吧?
为了文章中所说的问题,我删除了我VPS上的wordpress。如果早知道这个问题,我就不会换了。不过,想想WORDpress在那么小内存的VPS上跑,也会很痛苦吧?所以还是让他跑跑一些简单的内容就完事了。原文在http://www.jefflei.com/post/884.html
--START--
Wordpress2.7的一键自动更新很好用。可是在使用Wordpress插件自动更新和安装时,有时发现需要提示输入ftp信息:
FTP Connection Information
Host:
Username:
Password:
这是Wordpress的一个bug,在某些文件系统上有问题从wordpress2.5到2.7都一直没有更新,在国外网站上查了下修复方法如 下:
1. 编辑wp-admin/includes/file.php找到以下这行
if(getmyuid()==fileowner($tempFile)){
把这句中把getmyuid改成posix_getuid
2. 完成以上修改应该不会再要输入ftp信息了,但是有时候会告知目录不对,在wp-content目录下建立upgrade目录
chown www:www wp-content/upgrade
chmod +w wp-content/upgrade
做完以上设置应该就可以自动更新了。
--EOF--
根据我的估计,有两个人可能会用到这个,虫少侠(http://enjoyphp.com)和拉拉(http://www.ifotos.net)。我想,他们两个看到我这篇博客的时候,估计会感动的帮我点广告的吧?