* 官方文档(http://mp.weixin.qq.com/wiki/home/index.html)php
*《微信公众平台搭建与开发揭秘》html
* 玩转微信公众平台(http://blog.csdn.net/column/details/weixin-start530.html);java
* 订餐系统之微信点餐&订餐系统之微信支付,踩了官方demo的坑;git
编辑模式比较简单,登陆mp.weixin.qq.com一看就会,在此略过。若要申请自定义菜单>微信认证>300认证费用。。。github
接着在文档中下载官方实例代码:wx_sample.zip;web
同窗们可跳过本文BAE3.0和git部分,直接使用SAE{不支持git,只支持SVN}apache
理由(http://my.oschina.net/SnifferApache/blog/316765#OSC_h1_1)segmentfault
BAE3.0计费说明(http://developer.baidu.com/wiki/index.php?title=docs/cplat/bae/bill),能够先使用后付费,用来测试还好。服务器
按照自带文档操做(http://developer.baidu.com/wiki/index.php)微信
参考(http://blog.csdn.net/bingtianxuelong/article/details/17843111)
建立php-web类型的工程以后,进入开发者服务管理页面就能够看到本身刚刚建立的工程,点击“点击查看”超连接能够看到页面内容默认为Welcome to Baidu Cloud
* 进入百度开发者中心并注册;
* 管理控制台>开发者服务管理>建立工程“微信公众接口123”;
* 点击应用引擎>复制git地址;
个人git地址:https://git.duapp.com/appidl0asecb6cc;
使用git将官网wx_sample.php上传,git新手可参考
(http://my.oschina.net/SnifferApache/blog/308863)
Administrator@FENG /f/workspace/wechat
$ git clone https://git.duapp.com/appidl0asecb6cc
Cloning into 'appidl0asecb6cc'...如下略
* pull操做也能够:
Administrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git pull
Username for 'https://git.duapp.com': fengshenjie.email@qq.com
Password for 'https://fengshenjie.email@qq.com@git.duapp.com':
Already up-to-date.
* 将微信官方实例php放到本地,上传到BAE
Administrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.Changes to be committed:
(use "git reset HEAD <file>..." to unstage)new file: readme.txt
new file: wx.php
Administrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git commit -m "add readme.txt and wx.php"
[master a04a549] add readme.txt and wx.php
warning: LF will be replaced by CRLF in wx.php.
The file will have its original line endings in your working directory.
2 files changed, 90 insertions(+)
create mode 100644 readme.txt
create mode 100644 wx.phpAdministrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git push origin master
Username for 'https://git.duapp.com': fengshenjie.email@qq.com
Password for 'https://fengshenjie.email@qq.com@git.duapp.com':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 1.32 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://git.duapp.com/appidl0asecb6cc
0c97176..a04a549 master -> master
【注意:中间可能会由于网速而失败,多试两次就好啦。貌似BAE3.0没有在线编辑代码的功能了,更没有BAE2.0下的git管理.(http://developer.baidu.com/wiki/index.php?title=docs/cplat/rt/manage/git)差异好大shit。
因此咱们只能老老实实本地编辑了。。。】
*百度开放云PHP文档
(http://developer.baidu.com/wiki/index.php?title=docs/cplat/bae/php)
此时BAE管理控制台页面(http://developer.baidu.com/console)状态一栏会提示“有新版”,点击操做一栏的“当即发布”便可发布成功。
能够打开http://lawlietfans.duapp.com/wx.php(域名/本身的php页)看看效果。
打开开发者中心>配置项>修改配置,填写URL为http://lawlietfans.duapp.com/wx.php,Token为weixin,提交成功以后,启用服务器配置便可。
【注意:启用开发者模式以后,用户发送的消息将自动转发到该配置地址,原先设置的自动回复和自定义菜单失效】
鉴于BAE3.0并不能查看代码历史,因此很是有必要同时上传到多个远程仓库。
* 在git.oschina.net新建项目wechatProject(空项目);
* 在git中添加远程仓库
Administrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git remote add oschina git@git.oschina.net:snifferapache/wechatProject.gitAdministrator@FENG /f/workspace/wechat/baiduweixin123 (master)
$ git push -u oschina master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.如下略【新手可参考http://my.oschina.net/SnifferApache/blog/308863#OSC_h1_7】
【注意:
在git.oschina.net新建仓库的时候若勾选了初始化文件、开源许可证等以后,生成的不是空项目。
在这种状况下我进行push操做会出现error: failed to push some refs to 'git……
】
若是你将本地GIT版本库push到github上一个空的版本库时可能会出现以下错误error:src refspec master does not match any
这是缘由: 本地版本库为空, 空目录不能提交 (只进行了init, 没有add和commit)。
根据(http://www.cnblogs.com/xfiver/archive/2012/04/07/2435840.html)进行pull以后依然失败。
/f/workspace/wechat/baiduweixin123 (master) $ git pull oschina From git.oschina.net:snifferapache/wechatProject * [new branch] master -> oschina/master You asked to pull from the remote 'oschina', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line.
在(http://segmentfault.com/q/1010000000367632#a-1020000000369754)知多是远程仓库问题,遂清空wechatProject,从新push一下便成功了。之后要更新两个远程仓库只需以下操做便可。
git push origin master git push oschina master
“回复文本”以及回复图文等,see(http://my.oschina.net/SnifferApache/blog/316765#OSC_h1_3)