Post actualizado el día octubre 29, 2026 by DeiviSanzPlay
XAMPP has become the most widely used local development environment for testing PHP and MySQL sites. Its simple installation, however, hides a reality: when something fails, the messages shown by Apache or MySQL rarely explain the real cause. This guide gathers the most common failures and how to solve them without reinstalling everything from scratch.
Apache won’t start: port 80 is in use
This is the most frequent problem. Skype, IIS, some printing services, or even another web server may be using port 80. To confirm this on Windows, open the command prompt as administrator and run netstat -ano | findstr :80. The last column shows the PID of the process occupying it. If you don’t need it, close it from Task Manager.
If you prefer to keep both services, edit the httpd.conf file inside the xampp/apache/conf folder and change Listen 80 to Listen 8080. Do the same with ServerName localhost:8080. Then, go to http://localhost:8080.
MySQL stops immediately
When the control panel shows MySQL in red, check the mysql_error.log file in xampp/mysql/data. The typical causes are:
- Port 3306 in use by another instance of MySQL or MariaDB. Change the port in my.ini and restart.
- Corrupted data files after an abrupt shutdown. Run mysqld –innodb-force-recovery=1 from the console to recover InnoDB tables.
- Insufficient permissions on the data folder. On Windows, run XAMPP as administrator.
Error «Access denied for user ‘root’@’localhost'»
This occurs when the root password changed or was lost. Stop MySQL, open a console in xampp/mysql/bin and launch mysqld –skip-grant-tables. In another window, log in with mysql -u root and run ALTER USER ‘root’@’localhost’ IDENTIFIED BY »; followed by FLUSH PRIVILEGES;. Restart the service and return to phpMyAdmin.
The page shows PHP code instead of executing it
If the browser displays the source code, Apache is not interpreting PHP. Check that the line LoadModule php_module exists in httpd.conf with the correct path to php8.x.x/php8apache2_4.dll. Also verify that the AddType application/x-httpd-php .php block is present. A typo in the path breaks all execution.
phpMyAdmin returns error 403 or 404
Check the alias in xampp/apache/conf/extra/httpd-xampp.conf. It must point to the real phpMyAdmin folder. If you changed the root password, update config.inc.php with the new credentials; otherwise, you will see an authentication error that looks like a server failure.
Extension errors: «PHP Startup: Unable to load dynamic library»
When enabling extension=gd or extension=zip in php.ini, the path must match the ext folder. Check that the extension_dir line points to xampp/php/ext with correct slashes. If the DLL does not exist, the solution is to download the exact PHP version or disable the extension.
Tips to prevent future failures
Stop Apache and MySQL from the panel before shutting down the computer. Avoid moving the xampp folder to another path after installing it; if you do, update the paths in the configuration files. Make periodic backups of htdocs and the databases with mysqldump. And when something fails, always check the logs before touching configurations: apache/logs/error.log, mysql/data/mysql_error.log and php/logs/php_error_log contain the exact clue.