Essential Tips for Beginners: Navigating XAMPP, Apache, PHP Versions, and MySQL

A Crucial Lesson for WordPress Developers: Managing Local Development Environments with XAMPP and Beyond

Recently, I experienced a significant learning curve that I believe is valuable for developers working with local servers, especially those new to the domain. After upgrading my PC’s RAM from 16GB to 32GB, I encountered an unexpected series of issues that highlighted the importance of understanding your development stack and the risks involved in automatic updates.

Initially, everything seemed smooth, but then problems started occurringโ€”Blue Screen of Death (BSOD) errors and system restarts became frequent. To troubleshoot, my manager recommended a comprehensive system update using winget, along with system scans. Although these checks all came back clean, the update process inadvertently upgraded several key components, including Docker, Herd, and most notably, XAMPP.

The aftermath was painful: all my local server dataโ€”my ‘htdocs’ directory and MySQL databasesโ€”were wiped out. Storing ‘htdocs’ on a separate drive initially saved me some trouble, but the loss of the database data was a hard hit. My efforts to restore the MySQL data were unsuccessful, leading to errors like “table does not exist in the engine,” which halted my local development workflow.

In the end, I managed to manually restore access to critical applications by recreating specific tables, such as single-sign-on, to regain some productivity. This experience, however, served as a stark warning about relying heavily on tools like XAMPP for local development. Although Docker is generally recommended for its flexibility and containerization benefits, my current environment restricts meโ€”no server access, only FTP and GitHub Actions, and a shared server setup.

Determined to find a sustainable solution, I dedicated a full Saturday to rethinking my approach. I realized that since XAMPP essentially runs Apache, MySQL, and PHP together, I could set up each component separatelyโ€”installing Apache, configuring MySQL, and managing PHP versions independently. This modular approach offers greater control and reduces the risk of losing data with updates.

After several hours of trial and error, I successfully configured a personalized local environment. Key improvements included separating the ‘htdocs’ and database directories, ensuring that system updates wouldnโ€™t wipe my working environment. Now, I can also easily switch between PHP versions as needed, which is essential for testing compatibility.

For those interested, I documented my process and created a detailed setup guide on GitHub:
[https://github.com/Kerem


Leave a Reply

Your email address will not be published. Required fields are marked *