微信公众平台开发(一)

来源:互联网 发布:予知教育 编辑:程序博客网 时间:2024/04/23 18:22

注册登录成功微信公众平台后,右下角有开发者中心,点击配置服务器URL和token

微信有一个官方的配置代码可以下载http://mp.weixin.qq.com/mpres/htmledition/res/wx_sample.zip

将代码解压后,上传至服务器任意地址,比如说放在/var/www/xixi下

然后要在前台配置域名,http://next.su.baidu.com/website/

添加网站或点击已有的网站,设置子域名子域名设置

设置类型为A型的子域名,这样前台就设置好了。

接下来给后台配置转发,在/usr/local/nginx/conf这里编辑nginx.conf文件

server {        listen       80;        server_name  xx.xxxx.com;        location / {            root   /var/www/xixi;            index  index.html index.htm index.php;        }        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        location ~ \.php$ {            root           /var/www/xixi;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }    }
编辑好了后,要重启nginx,到/usr/local/nginx/sbin后,输入./nginx -s reload。这样后台也配置好了。

最后就是到微信开发者平台去设置URL和token了,这样就配置成功了URLtoken


0 0
原创粉丝点击