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.
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.
Registration address: https://mp.weixin.qq.com
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.
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.
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
Click "Submit". If everything is set correctly, it will prompt "Submission successful".
BAE interface information
SAE interface information
At this point, the configuration is complete.