we installed XAMPP originally into C:\wamp, but then you renamed the folder to C:\xampp.
๐ The problem: XAMPP configuration files and services (Apache, MySQL, etc.) were installed with absolute paths pointing to C:\wamp. When you renamed the folder, those paths are now broken, so it still tries to start from C:\wamp.
Table of Contents
Toggle1. Check and update configuration paths
-
Go to
C:\xampp\
(your renamed folder). -
Open
xampp-control.exe
as administrator. -
If services fail, you need to update config files:
-
Open
C:\xampp\apache\conf\httpd.conf
Search forC:/wamp/
and replace withC:/xampp/
-
Open
C:\xampp\php\php.ini
and check for old paths. -
Also check
my.ini
inC:\xampp\mysql\bin
forbasedir
anddatadir
.
-
2. Check Windows Services
-
Press
Win + R
โ typeservices.msc
โ Enter. -
Look for Apache and MySQL services.
-
If you installed them earlier, they are registered with
C:\wamp\...
. -
You need to uninstall and reinstall the services:
-
Open XAMPP Control Panel.
-
Click the red X (service remove) for Apache & MySQL.
-
Then install again (click the checkbox/service install).
-
3. Easiest fix (recommended)
If you donโt have data inside MySQL yet โ
Just uninstall XAMPP completely and reinstall it directly into C:\xampp\
. That way all paths are correct from the start.
You already have databases or projects inside C:\wamp
that you want to keep.
In that case, donโt just uninstall everything blindly โ weโll do it safely.
โ Steps to Fix Without Losing Data
1. Backup MySQL databases (important)
-
Go to
C:\wamp\mysql\data\
-
Copy the entire
data
folder to a safe place (e.g. Desktop).
(This contains all your MySQL databases)
2. Fix Apache & MySQL config paths
-
Open these files with Notepad:
-
C:\xampp\apache\conf\httpd.conf
โ Search forC:/wamp
and replace withC:/xampp
. -
C:\xampp\php\php.ini
โ Search and update anyC:/wamp
. -
C:\xampp\mysql\bin\my.ini
โ Updatebasedir
anddatadir
to:basedir="C:/xampp/mysql"
datadir="C:/xampp/mysql/data"
-
3. Remove old Windows services
-
Press
Win + R
โ typeservices.msc
. -
Look for
Apache2.4
orMySQL
services pointing toC:\wamp
. -
Stop them โ right-click โ Properties โ check path.
-
Back in XAMPP Control Panel, click the red X to uninstall the broken services.
4. Reinstall services with correct path
-
Open
xampp-control.exe
as Administrator. -
Next to Apache and MySQL, click the red X to install services again.
(Now theyโll point toC:\xampp
.)
5. Restore your databases
-
Copy back your saved
data
folder into:C:\xampp\mysql\data\
(replace if empty). -
Start MySQL in XAMPP Control Panel โ your databases should appear.
โก Alternative (cleaner way):
If configs are too messy, reinstall XAMPP directly into C:\xampp
, then copy:
-
htdocs
(your projects) โ newC:\xampp\htdocs\
-
data
(your databases) โ newC:\xampp\mysql\data\
Since we renamed the folder back to C:\wamp
, all the paths in httpd.conf
, php.ini
, and my.ini
are valid again โ so Apache & MySQL start without errors. โ
๐ Key Point
XAMPP is path-dependent.
If you install it in C:\wamp
, it expects configs & services to always point there. Simply renaming the folder (to C:\xampp
or anything else) breaks it, unless you manually update all config files and services.
write the exact find & replace lines for httpd.conf
, php.ini
, and my.ini
so you can just edit quickly?
โ
If you want to move it in the future (to C:\xampp
)
-
Rename the folder.
-
Edit:
-
httpd.conf
โ changeC:/wamp
โC:/xampp
-
php.ini
โ update any old paths -
my.ini
โ updatebasedir
anddatadir
-
-
Remove & reinstall services from XAMPP Control Panel.
๐ For now, if itโs working fine in C:\wamp
, you can just leave it there โ no harm at all.
Do you want me to show you the exact lines inside httpd.conf and my.ini youโd need to change, in case you ever want to move it permanently to C:\xampp
?
1. Apache config (httpd.conf
)
Location:
C:\xampp\apache\conf\httpd.conf
Look for these lines (they will currently say C:/wamp/...
) and change them:
# Change this
Define SRVROOT "C:/wamp/apache"
# To this
Define SRVROOT "C:/xampp/apache"
# Change this
DocumentRoot "C:/wamp/htdocs"
<Directory "C:/wamp/htdocs">
# To this
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
2. Apache extra config (httpd-xampp.conf
)
Location:
C:\xampp\apache\conf\extra\httpd-xampp.conf
Search for C:/wamp
and replace with C:/xampp
.
For example:
<Directory "C:/wamp/phpMyAdmin">
becomes:
<Directory "C:/xampp/phpMyAdmin">
3. MySQL config (my.ini
)
Location:
C:\xampp\mysql\bin\my.ini
Change these:
# Before
basedir="C:/wamp/mysql"
datadir="C:/wamp/mysql/data"
# After
basedir="C:/xampp/mysql"
datadir="C:/xampp/mysql/data"
4. PHP config (php.ini
)
Location:
C:\xampp\php\php.ini
This one usually doesnโt contain hard paths, but search for C:/wamp
just in case (sometimes extensions or logs are set with absolute paths). Replace with C:/xampp
.
5. Re-register services
-
Open XAMPP Control Panel as Admin.
-
Click the red X next to Apache/MySQL โ uninstall service.
-
Click again to reinstall (now theyโll use
C:\xampp
).
โก After doing this, XAMPP will work fine under C:\xampp
.
Your htdocs
projects and MySQL data
folder can just be moved over safely.