Deploying a WeChat Mini Program with PHP: Step‑by‑Step Guide
This guide walks developers through deploying a WeChat Mini Program with PHP by authorizing Tencent Cloud on the WeChat Public Platform, installing the developer tools, importing the wafer2‑quickstart‑php demo from GitHub, configuring credentials, and uploading the code to create a ready‑to‑use cloud environment.
WeChat Mini Programs have become widely adopted by enterprises and merchants. Because the single‑language Node.js solution can no longer meet all users, Tencent Cloud has added a PHP demo tutorial and source code, meaning that WeChat Mini Programs now support development with PHP.
How can developers set up their own Mini Program development environment?
In short, the process consists of four steps.
Step 01 – Authorize Tencent Cloud via the WeChat Public Platform
Log in to the WeChat Public Platform, go to the Mini Program backend, and enable Tencent Cloud services under Settings → Developer Tools. The cloud status will synchronize with the Mini Program developer tool after the first deployment.
Step 02 – Install the Development Tools
Download and install the WeChat Developer Tools, then scan the QR code with the WeChat account bound to the Mini Program to log in.
Step 03 – Import the PHP Demo and Configure
You can obtain the demo from the GitHub repository wafer2-quickstart-php. Two ways are provided:
Visit the repository page, click the clone or download button, then select Download ZIP to get the packaged demo code.
Clone the repository directly:
git clone https://github.com/tencentyun/wafer2-quickstart-php.gitStep 04 – Upload and Deploy the PHP Code
Open the WeChat Developer Tools installed in step 02, click the "Mini Program Project" button, enter the Mini Program AppID, and select the directory downloaded in the previous step. Important: Choose the quickstart root directory (which contains project.config.json), not just the client folder.
Open server/config.php in the demo and replace the mysql password field with your Mini Program AppID, then save.
Click the Tencent Cloud icon in the top‑right corner, choose "Upload Test Code", select "Module Upload", check all options, enable "Automatically install dependencies after deployment", and confirm to start uploading.
After the upload finishes, click "Details", then "Tencent Cloud Status" to view the automatically assigned development environment request domain.
Copy the full domain (including https://), open client/config.js, paste the domain into the host field, and save. The editor will recompile the Mini Program and the simulator will display the client demo.
In the simulator, click "Login"; a "Login successful" message indicates that the environment is ready for further development.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
