PHP WeChat public platform development (1) Configuration interface_PHP tutorial

WBOY
Release: 2016-07-13 10:36:28
Original
1145 people have browsed it

Introduction: WeChat is one of the software with a high installation rate on mobile terminals. Its public account service, as a marketing and promotion platform for websites or media, has increasingly demonstrated its strength in the mobile Internet trend. As a well-established WEB server development language, PHP can naturally perfectly fit the WeChat development model and create a public account suitable for your own business.

1. Introduction

The WeChat public platform is a new functional module added by Tencent on the basis of WeChat. Through this platform, individuals and enterprises can create a WeChat public account and achieve all-round communication with specific groups through text, pictures, and voice. interactive.

2. Communication mechanism

3. Register a WeChat public platform account

Registration address: https://mp.weixin.qq.com

4. Server-side configuration

4.1 Sample code settings

WeChat public platform provides a PHP sample code:

http://mp.weixin.qq.com/mpres/htmledition/res/wx_sample.zip

Download it, unzip it, and open it for editing.

Set the token value to the value you need. The token can be filled in by the developer to generate a signature.


After editing, save and close the file, change the file wx_sample.php to a custom name, here to wxapi.php, and package it again into wxapi.zip.

4.2 Server platform settings

If you have your own server and supports PHP, you can upload the interface file to the server. If you do not have your own server, you can choose some free cloud platforms for development, such as Baidu Application Engine BAE (http://developer.baidu.com /bae), Sina cloud platform SAE (http://sae.sina.com.cn/).

Baidu BAE Settings

a. Register a BAE account and log in

https://passport.baidu.com/v2/?reg®Type=1&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F


b. Join the Developer Center


c. Create application

Select "mobile web application" as the access method.

d. Hosting settings

Select Cloud Environment (BAE) -> Hosting Settings.

Environment type Select "PHP".

e. Create a new version and upload the interface file

f. Go online and get the link


The obtained URL is: http://zhuojin.duapp.com/

Note: zhuojinsz has been registered by me before, so it cannot be registered again. The second-level domain name that should be obtained here should be the same as written in the screenshot above.

BAE is set up.

Sina SAE Settings

a. Register an SAE account and log in

http://sae.sina.com.cn/

b. Create a new application

My Home Page -> Create New App

c. Configure application

d. Upload code

Application Management -> Code Management -> Upload Code Package

e. Get URL address

The obtained URL address is: http://1.zhuojin.sinaapp.com/

SAE configuration is complete.

5.Configure interface

5.1 Log in to the WeChat public platform -> High-power functions -> Development mode

5.2 Become a developer

5.3 Interface configuration information

Fill in the URL with the BAE URL obtained above: http://zhuojin.duapp.com/, plus the name of the uploaded php file. That is http://zhuojin.duapp.com/wxapi.php

Token fill in the custom token value, here is zhuojinsz.

For SAE, fill in the URL http://1.zhuojin.sinaapp.com/wxapi.php

5.4 Submit

Click "Submit". If everything is set correctly, it will prompt "Submission successful".

5.5 View interface configuration information

BAE interface information

SAE interface information

5.6 Turn on development mode

At this point, the configuration is complete.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/739150.htmlTechArticleIntroduction: WeChat is one of the software with a high installation rate on the mobile terminal, and its public account service serves as a website or media The marketing and promotion platform is increasingly showing itself in the mobile Internet trend...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!