user1493559
user1493559

Reputation: 359

How do I change the IP address in XAMPP for Windows?

I've been trying to figure out how I can change my server config for XAMPP so that it doesn't have a memory fault when both Windows and the server are trying to access localhost at the same time. Basically I want XAMPP to be IP of 127.0.1.1 or something similar so it doesn't interfere with the localhost used by the system so I can browse the web and my websites that I'm developing. What is happening is that if I have XAMPP and Eversoft's first page 2000 v2.0 running at the same time, I'll get a BSOD (blue screen of death) in the middle of editing my sites. This is an intermittent problem, but always happens with these two programs.

Upvotes: 11

Views: 102215

Answers (5)

Yassine Ben Aouicha
Yassine Ben Aouicha

Reputation: 21

You can follow these steps :
Step 1 : Open Xampp

Step 2 : Click on Config and select and click on Appache(httpd.conf) to open the file in the notepad

Step 3 : Press ( Ctrl/Cmd + f ) and search for listen 80 to change the port and choose a suitable port number for you (between 1024 to 49151)

Step 4 : In the search box again type and search for Localhost and change it's value to the desired ip adress eg. (0.0.0.0:4040) // Your ip adress

You can follow the images down below :

Image 1 :

Image 2 :

Image 3

Upvotes: 1

Nageen
Nageen

Reputation: 1759

These are the steps to follow when you want your PHP application to be installed on a LAN server (not on web)

  1. Get the internal IP or Static IP of the server (Ex: 192.168.1.193)
  2. Open XAMPP>apache>conf>httpd.conf file in notepad
  3. Search for Listen 80
  4. Above line would read like- #Listen 0.0.0.0:80 / 12.34.56.78:80
  5. Change the IP address and replace it with the static IP
  6. Save the httpd.conf file ensuring that the server is pointed to #Listen 192.168.1.193:80
  7. In the application root config.php (db connection) replace localhost with IP address of the server

Note: If firewall is installed, ensure that you add the http port 80 and 8080 to exceptions and allow to listen. Go to Control Panel>Windows Firewall>Allow a program to communicate through windows firewall>Add another program Name: http Port: 80 Add one more as http - 8080

If IIS (Microsoft .Net Application Internet Information Server) is installed with any Microsoft .Net application already on server, then it would have already occupied 80 port. In that case change the #Listen 192.168.1.193:80 to #Listen 192.168.1.193:8080

Upvotes: 8

user1493559
user1493559

Reputation: 359

Just edit c:\xampp\apache\conf\httpd.conf and change the Listen 80 to Listen 127.0.0.2:80 or whatever ip address you want. Make sure you place : between the ip address and port number, in this case it was port 80.

Upvotes: 15

omidshadbash
omidshadbash

Reputation: 61

Hint:
first part=file location --- second part=find in the file --- third part=replace with finded text

How Change "127.0.0.1" in Xampp To "127.0.0.2" (or paste your favorite ip instead 127.0.0.2)

(C:\xampp\apache\conf\httpd.conf) --- Listen 80 --- Listen 127.0.0.2:80
(C:\xampp\apache\conf\extra\httpd-ssl.conf) --- Listen 443 --- Listen 127.0.0.2:443
(C:\xampp\php\php.ini) --- ;xdebug.remote_host = "127.0.0.1" --- ;xdebug.remote_host = "127.0.0.2"
(C:\xampp\phpMyAdmin\config.inc.php) --- $cfg['Servers'][$i]['host'] = '127.0.0.1'; --- $cfg['Servers'][$i]['host'] = '127.0.0.2';

How Change "Localhost" in Xampp To "myhost" (or paste your favorite name instead myhost)

  • xampp control panel admin butoons still open localhost

    (C:\xampp\apache\conf\httpd.conf) --- ServerName localhost:80 --- ServerName myhost:80
    (C:\xampp\php\php.ini) --- ; SMTP = localhost --- ; SMTP = myhost
    (C:\Windows\System32\drivers\etc\HOSTS) --- 127.0.0.1 localhost --- 127.0.0.2 localhost
    127.0.0.2 myhost >>> #(next line after 127.0.0.2 localhost)

Upvotes: 3

Alex L.
Alex L.

Reputation: 821

You can point 127.0.1.1 to 127.0.0.1 in your windows hosts file (Windows/system32/driver/etc)

Upvotes: -5

Related Questions