If you’re working on IoT projects, the ESP32 with XAMPP server combination offers a powerful way to create your own local server environment for testing, logging, and interacting with devices. In this guide, you’ll learn how to connect your ESP32 board to a XAMPP server running on Windows and send sensor data via HTTP POST requests.
Why Use ESP32 with XAMPP Server
The ESP32 is a Wi-Fi-enabled microcontroller widely used in smart home, industrial, and automation projects. Pairing ESP32 with XAMPP server allows developers to store, display, and manage sensor data locally without relying on cloud services.
Using XAMPP, which includes Apache, MySQL, and PHP, you can:
Create custom dashboards
Log data into a MySQL database
Use PHP to handle requests from ESP32
Visualize real-time sensor data locally
This setup is ideal for students, hobbyists, or professionals wanting full control over their data.
Replace 192.168.1.100 with the actual IP address of the PC running XAMPP (you can find it using ipconfig in CMD).
Also add your SSID and Password in code.
In my case this line will be updated http.begin(“http://192.168.1.100/esp_data.php”); to http.begin(“http://192.168.100.15/esp_data.php”);
Make sure ESP32 and PC are connected to same network
Step 3: View the Data
Go to C:\xampp\htdocs\data.txt to see the data saved by the ESP32. Each time the ESP32 sends a POST request, temperature and humidity values are logged to the file.
Serial Monitor output should be like this:
You can later enhance this setup by saving the data to a MySQL database instead of a .txt file.
Common Issues and Fixes
ESP32 not connecting to Wi-Fi: Check SSID and password
Connection refused: Ensure Apache is running in XAMPP
PHP file not responding: Use the correct local IP and path
Firewall blocking requests: Allow Apache through Windows Firewall
Conclusion
Using ESP32 with XAMPP server is an effective way to prototype and test IoT projects without needing internet access or third-party services. Whether you’re logging temperature, controlling devices, or building a dashboard, this setup gives you flexibility and control.
Start simple, then explore more advanced features like MySQL integration, data visualization, and real-time updates. If you’re serious about local IoT development, learning to use ESP32 with XAMPP server is a must.