Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
- Watch Video
PHP Using PHP with MySQL Connecting PHP to MySQL Installing MySQL with MAMP
MUZ141140 Dennis Pomerai
10,215 Points
Posted August 29, 2015 2:08pm by MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
I have installed xampp on my machine and it give me that the port is in use. I dont know what to do next.
11 Answers
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
This happens sometimes, give this a try:
- Click "Config" button
- Select "httpd.conf" from the dropdown.
- On the line where it says "Listen 80" change that to "Listen8080"
- Save the file.
- Close the file.
- Open browser and type " localhost:8080 "
- Smile because it worked.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
1:43:08 PM [Apache] Attempting to start Apache app...1:50:26 PM [Apache] Problem detected!1:50:26 PM [Apache] Port 80 in use by "Unable to open process" with PID 8852!1:50:26 PM [Apache] Apache WILL NOT start without the configured ports free!1:50:26 PM [Apache] You need to uninstall/disable/reconfigure the blocking application1:50:26 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port1:50:26 PM [Apache] Problem detected!1:50:26 PM [Apache] Port 443 in use by "Unable to open process" with PID 8852!1:50:26 PM [Apache] Apache WILL NOT start without the configured ports free!1:50:26 PM [Apache] You need to uninstall/disable/reconfigure the blocking application1:50:26 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port1:50:26 PM [Apache] Attempting to start Apache app...1:50:26 PM [Apache] Status change detected: running1:50:27 PM [Apache] Status change detected: stopped1:50:27 PM [Apache] Error: Apache shutdown unexpectedly.1:50:27 PM [Apache] This may be due to a blocked port, missing dependencies, 1:50:27 PM [Apache] improper privileges, a crash, or a shutdown by another method.1:50:27 PM [Apache] Press the Logs button to view error logs and check1:50:27 PM [Apache] the Windows Event Viewer for more clues
[Sat Sep 12 11:55:08.191049 2015] [ssl:warn] [pid 8852:tid 428] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name[Sat Sep 12 11:55:08.928542 2015] [ssl:warn] [pid 8852:tid 428] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name[Sat Sep 12 11:55:16.124712 2015] [mpm_winnt:notice] [pid 8852:tid 428] AH00455: Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11 configured -- resuming normal operations[Sat Sep 12 11:55:16.124712 2015] [mpm_winnt:notice] [pid 8852:tid 428] AH00456: Apache Lounge VC11 Server built: Jul 12 2015 10:56:48[Sat Sep 12 11:55:16.124712 2015] [core:notice] [pid 8852:tid 428] AH00094: Command line: 'C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'[Sat Sep 12 11:55:16.177747 2015] [mpm_winnt:notice] [pid 8852:tid 428] AH00418: Parent: Created child process 6904[Sat Sep 12 11:55:17.519641 2015] [ssl:warn] [pid 6904:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name[Sat Sep 12 11:55:17.723029 2015] [ssl:warn] [pid 6904:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name[Sat Sep 12 11:55:17.916157 2015] [mpm_winnt:notice] [pid 6904:tid 472] AH00354: Child: Starting 150 worker threads.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
I tried to follow what you said and this is what i got.
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
Is there a space in Listen8080? It should be Listen 8080.
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
Try this:Listen 7777ServerName localhost:7777
Scan that file and replace 80 or 8080 with 7777 , that port shouldn't be in use. Then give it a restart. Let me know how it works out.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
2:15:52 PM [main] Initializing Control Panel2:15:52 PM [main] Windows Version: Windows 8 Pro 64-bit2:15:52 PM [main] XAMPP Version: 5.6.112:15:52 PM [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]2:15:52 PM [main] You are not running with administrator rights! This will work for2:15:52 PM [main] most application stuff but whenever you do something with services2:15:52 PM [main] there will be a security dialogue or things will break! So think 2:15:52 PM [main] about running this application with administrator rights!2:15:52 PM [main] XAMPP Installation Directory: "c:\xampp\"2:15:53 PM [main] Checking for prerequisites2:15:53 PM [main] All prerequisites found2:15:53 PM [main] Initializing Modules2:15:53 PM [mysql] XAMPP MySQL is already running on port 33062:15:53 PM [main] Enabling autostart for module "Apache"2:15:53 PM [main] Starting Check-Timer2:15:53 PM [main] Control Panel Ready2:15:53 PM [Apache] Autostart active: starting...2:15:53 PM [Apache] Attempting to start Apache app...2:15:55 PM [Apache] Attempting to start Apache app...2:15:55 PM [Apache] Status change detected: running2:15:55 PM [Apache] Status change detected: stopped2:15:55 PM [Apache] Error: Apache shutdown unexpectedly.2:15:55 PM [Apache] This may be due to a blocked port, missing dependencies, 2:15:55 PM [Apache] improper privileges, a crash, or a shutdown by another method.2:15:55 PM [Apache] Press the Logs button to view error logs and check2:15:55 PM [Apache] the Windows Event Viewer for more clues2:15:55 PM [Apache] If you need more help, copy and post this2:15:55 PM [Apache] entire log window on the forums2:15:58 PM [Apache] Attempting to start Apache app...
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
Cool, almost there. Close down xampp, and open it with Admin Rights. Instead of opening it by double clicking, right click on the xampp icon, from the context menu select run as admin, and give the start up a try.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
thanks Jeffrey,that works how do i open the localhost in the browser.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit;?>Something is wrong with the XAMPP installation :-(
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
when I open the index.php that is what it is showing me.
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
That sucks! You can clean that up and reinstall it. Chances are you will run into the same issues with the ports, and remember to run it in with admin rights. Good luck!
PLUS
Jeffrey Pavlov
Courses Plus Student 15,820 Points
Jeffrey Pavlov Courses Plus Student 15,820 Points Jeffrey Pavlov
Let me know if you get this going. If not, I can always document the steps and post them to my blog so you and others can use them.
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?> Something is wrong with the XAMPP installation :-(
MUZ141140 Dennis Pomerai
10,215 Points
MUZ141140 Dennis Pomerai 10,215 Points MUZ141140 Dennis Pomerai
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?> Something is wrong with the XAMPP installation :-(
Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.
FAQs
How do I unblock port 80 in Apache? ›
- In the XAMPP Control panel, click on Config :
- Change the editor to something better than Notepad. ...
- Click on Config by Apache and select httpd.conf:
- Find “Listen 80” and change it to “Listen 8080”.
- Find “ServerName localhost:80” and change it to “ServerName localhost:8080”.
- Go to C:\xampplite\apache\conf.
- Open httpd.conf files.
- Search for Listen 80.
- Change 80 to any other like 9080.
- Now XAMPP restart try to start server.
There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.
How do you fix Apache will not start without the configured ports free? ›Open Apache control panel goto config httpd-ssl.
Find 443 port Ctrl+f search 443 then edit all 443 to 4433. Then save config file. Now enjoy XAMPP and VMware workstation at the same time.
As port 80 is the default port for http, the most likely reason is that another web server (like IIS) is running on your machine. However, some other applications may also block port 80. One good example is Skype.
How do I know if my firewall is blocking port 80? ›- Type cmd in the search bar.
- Right-click on the Command Prompt and select Run as Administrator.
- In the command prompt, type the following command and hit enter. netsh firewall show state.
- This will display all the blocked and active port configured in the firewall.
...
- Launch RegEdit.
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP.
- Change the value of "start" to 4, which means disabled.
- Reboot your computer.
- Enter your router's IP address into your browser bar. Log in when prompted.
- Navigate to the "Port Forwarding" section and fill out the forwarding form.
- Check "Enabled" or "On" next to Port 80. Then, save your settings.
- Click Start.
- Type Control Panel and press Enter.
- Click System and Security.
- Click Windows Defender Firewall.
- Select Advanced settings, and then select Inbound Rules in the left pane.
- Right-click Inbound Rules, and then select New Rule.
- Select Port, and then click Next.
- Log into WHM as root.
- Scroll the left navigation bar down to the Restart Services section.
- Click on the name of the service you wish to restart (Example: HTTP Server (Apache)).
- The WHM will ask if you are sure you wish to restart the service; please click Yes.
How do you check whether Apache is properly running or not? ›
Check if Apache is running on Windows
After pressing Ctrl + Shift + Esc, start typing either "httpd.exe" or "apache.exe" and see if they appear on the list. If they do, then Apache is running.
Go to the Control Panel and launch "Windows Firewall" Go to "Advanced Settings" Select "Inbound Rules" in the left pane Select "New Rule" in the right pane In the New Inbound Rule Wizard, select "Port" as Rule Type, then click on "Next" Select "TCP and put "80" (and any other ports you want to open) in "Specific local ...
How can I tell if Apache is running on port 80? ›- lsof -i will list open ports and the corresponding applications. lsof | grep apache for apache. ...
- See /etc/hosts for IP addresses connected to names.
- See /etc/apache2/sites-enabled/ for settings about the sites that are active for Apache.
- See /etc/apache2/ports.conf for the Listen .
- Open a CMD window in Administrator mode by navigating to Start > Run > type cmd > right-click Command Prompt, then select Run as administrator.
- Use the netstat command lists all the active ports. ...
- To kill this process (the /f is force): taskkill /pid 18264 /f.
By default, the Apache webserver is instructed to listen and bind on port 80.0 for incoming connections. If you opt for a TLS setup, the server listens on port 443 for stable connections.
How do you check if a port is blocked? ›Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status. If the port is open, only a cursor will show. If the port is closed, a message will say Connect failed.
Is port 80 blocked by default? ›Note: TCP Port 80 is open for outgoing communications by default in most firewall software.
How do I get around ISP blocking port 80? ›If your Internet Service Provider is blocking Port 80, you can use our Port 80 Redirect feature listed under the modify hostname page. To do this, set the IP address and the port you would like http requests sent to in the fields pictured below.
How do I stop my firewall from blocking a port? ›- From the control panel choose Windows Firewall.
- Then go to advance setting from the menu on the left choose inbound rule.
- Select “New Rule” -> Port -> make sure that TCP is selected.
- Choose Specific local ports and fill the specific port that you want to allow.
Type "netstat -a" at the command prompt and press "Enter." After a few seconds, all of the open ports on the computer. Locate all of the entries that have an "ESTABLISHED," "CLOSE WAIT" or "TIME WAIT" value under the "State" header. These ports are also open on the router.
How do I know if my firewall is blocking an IP? ›
How Do I Know If My IP Is Being Blocked? To confirm you are blocked from accessing your server, you should try to log in to your web server, as usual, to see what kind of connection error message you're getting. This error will often provide a specific reason that your IP has been blocked.
How do I change my port 80 settings? ›- Open the file: [app-path]\server\server.properties.
- Enable port 80 (and 443) by changing the appropriate settings from N to a Y . ...
- Change the server port in all providers installed on your network. ...
- Change the server port in the User Client config file: ...
- Restart the Application Server.
From Services Manager (run: services. msc), stop and disable these Windows Services which are known to bind to port 80. Double click Service, and change 'Startup Type' to 'Disabled'… skype also using port 80 as default setting and you can uncheck it.
How do I find out who is using port 80? ›- From the Windows Start menu, select Run.
- In the Run dialog box, enter: cmd .
- Click OK.
- In the command window, enter: netstat -ano.
- A list of active connections is displayed. ...
- Start Windows Task Manager and select the Processes tab.
Navigate to your router's configuration page by typing the router's IP address into your browser. Find a settings tab for Ports, or Port Forwarding. Where indicated, input the number of the port you want to open. Where indicated, input the static IP address of the device you want the port to forward to.
How do I force a port to open on a network? ›Answer: From the Control Panel, navigate to System and Security, and click on Windows Firewall. Go to the Advanced settings and right-click on Inbound Rules on the left pane. Select New Rule, add the port and click Next. Pick the Protocol and the Port Number, click Next again.
How do you unlock a port on a router? ›- Locate your router's IP address.
- Head over to your router's settings.
- Enter your credentials (username and password).
- Look around for the Port Forwarding tab.
- Open your preferred port—for example, type 8080 to open port 8080.
- Save your settings.
Port blocking is a tool commonly used by ISPs, but the use of that tool can vary dramatically from ISP to ISP. Many ISPs use port blocking to protect their customers from security threats, but some have used it to block high bandwidth or competing applications.
What happens when a port is blocked? ›Port blocking can complicate application design and development and create uncertainty about whether applications will function properly when they are deployed. Port blocking can also cause applications to not function properly or “break” by preventing applications from using the ports they were designed to use.
What ports should be blocked on Firewall? ›- MS RPC TCP, UDP Port 135.
- NetBIOS/IP TCP, UDP Port 137-139.
- SMB/IP TCP Port 445.
- Trivial File Transfer Protocol (TFTP) UDP Port 69.
- System log UDP Port 514.
Do you need to restart Apache? ›
Apache needs to be told to re-read its configuration file before it will take account of changes, but it is not necessary to completely stop and restart our web server after each change. A rather faster mechanism is to cause it to reread its file to note changes.
How do I manually restart a server? ›- Open Settings in the Charms Bar. Click Power > Restart.
- Click Start. Click the arrow next to Shut down and select Restart from the menu.
- apachectl -k graceful.
- apache2ctl -k graceful.
- /etc/init.d/httpd graceful.
- /sbin/service httpd graceful.
- /etc/init.d/apache2 reload.
- Make sure the service is running. The first step to take in troubleshooting any service is to check that the service is running and able to function. ...
- Check your server configuration. ...
- Check Logs. ...
- Check other services.
- Verify your Apache HTTP Server configuration. ...
- Use the latest version of Apache HTTP Server. ...
- Apache HTTP Server logs. ...
- Use the mod_log_forensic module. ...
- Use the mod_whatkilledus module. ...
- Check third-party modules. ...
- Run Apache HTTP Server as a single process and use debugging tools.
- Step 1: Launch the XAMPP Apache configuration settings. First, go ahead and launch the XAMPP dashboard. ...
- Step 2: Change your default port settings in httpd. conf. ...
- Step 3: Update your default port settings in http-ssl. ...
- Step 4: Restart Apache.
- Open Apache Config File. Open terminal and run the following command to open Apache server configuration file. ...
- Change Apache Port Number. ...
- Open Virtual Host Configuration (for Ubuntu/Debian) ...
- Restart Apache Server.
- http://localhost/ Apache should respond with a welcome page and you should see "It Works!". ...
- http://127.0.0.1/ ...
- http://127.0.0.1:8080/
- Go to the Control Panel and launch "Windows Firewall"
- Go to "Exceptions"
- Add Port.
- Name: Apache_gsp.
- Port number: 80.
- Choose TCP.
- Click OK.
- For Microsoft Windows: netstat -ano | find "1234" | find "LISTEN" tasklist /fi "PID eq 1234"
- For Linux: netstat -anpe | grep "1234" | grep "LISTEN"
How do I free up port 80 on Windows 10? ›
To disable port 80, go to Windows Firewall with Advanced Security (just type it in the Start search box). On the left you'll see Outbound Rules, right-click on it and select New Rule... Then, select Port in rule type and hit Next. Select protocol TCP and type 80 in the Specific Remote Port box.
What is the easiest port to hack? ›- FTP (20, 21) FTP stands for File Transfer Protocol. ...
- SSH (22) SSH stands for Secure Shell. ...
- SMB (139, 137, 445) SMB stands for Server Message Block. ...
- DNS (53) DNS stands for Domain Name System. ...
- HTTP / HTTPS (443, 80, 8080, 8443) ...
- Telnet (23) ...
- SMTP (25) ...
- TFTP (69)
- Open Windows Start menu, and click the "Settings" icon, choose "Network&Internet", and "Windows Firewall"
- Find the "Advanced Settings" window and locate "Inbound Rules" on the left side of the panel.
- Click on "New Rule" on the right and choose "Port" option.
Open port does not immediately mean a security issue. But, it can provide a pathway for attackers to the application listening on that port. Therefore, attackers can exploit shortcomings like weak credentials, no two-factor authentication, or even vulnerabilities in the application itself.
How to unblock port 80 for Apache? ›- In the XAMPP Control panel, click on Config :
- Change the editor to something better than Notepad. ...
- Click on Config by Apache and select httpd.conf:
- Find “Listen 80” and change it to “Listen 8080”.
- Find “ServerName localhost:80” and change it to “ServerName localhost:8080”.
- Open Xampp Control Panel.
- Go to Config ► Service and Port Settings ► Apache.
- Replace the Main Port and SSL Port values with those chosen (e.g. 8012 and 8013 ).
- Save Service settings.
- Save Configuration of Control Panel.
- Restart the Apache Server. It should work now.
Go to the Control Panel and launch "Windows Firewall" Go to "Advanced Settings" Select "Inbound Rules" in the left pane Select "New Rule" in the right pane In the New Inbound Rule Wizard, select "Port" as Rule Type, then click on "Next" Select "TCP and put "80" (and any other ports you want to open) in "Specific local ...
How to change Port 80 in Apache? ›- Open the appropriate files for your operating system: ...
- Search for the string Port 80 and replace the value 80 with the desired port number.
- Search for the string Listen 80 and replace the value 80 with the same port number provided in the previous step.
- Save and exit the .
- From the control panel choose Windows Firewall.
- Then go to advance setting from the menu on the left choose inbound rule.
- Select “New Rule” -> Port -> make sure that TCP is selected.
- Choose Specific local ports and fill the specific port that you want to allow.
- Enter your router's IP address into your browser bar. Log in when prompted.
- Navigate to the "Port Forwarding" section and fill out the forwarding form.
- Check "Enabled" or "On" next to Port 80. Then, save your settings.
How do I check if Apache is running and listening on port 80? ›
Apache (httpd) service is running on RedHat EC2 instance at port 80 and command "curl localhost:80" shows the content of index. html file located at /var/www/html of the apache server. Below is the output of command "service httpd status", which shows that apache is running and listening on port 80 as well.
How do I know if port 80 is open on remote host? ›Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status. If the port is open, only a cursor will show.
How do I open Port 80 on my browser? ›- From the Start menu, click Control Panel, click System and Security, and then click Windows Firewall. ...
- Click Advanced Settings.
- Click Inbound Rules.
- Click New Rule in the Actions window.
- Click Rule Type of Port.
- Click Next.
- On the Protocol and Ports page click TCP.
- Open Apache Config File. Open terminal and run the following command to open Apache server configuration file. ...
- Change Apache Port Number. ...
- Open Virtual Host Configuration (for Ubuntu/Debian) ...
- Restart Apache Server.
To manage the whitelist in the Windows Firewall, click Start, type firewall and click Windows Defender Firewall. Click Allow a program or feature through Windows Firewall (or, if you're using Windows 10, click Allow an app or feature through Windows Firewall).
How do I open a blocked port? ›Answer: From the Control Panel, navigate to System and Security, and click on Windows Firewall. Go to the Advanced settings and right-click on Inbound Rules on the left pane. Select New Rule, add the port and click Next. Pick the Protocol and the Port Number, click Next again.
What ports should be blocked on firewall? ›- MS RPC TCP, UDP Port 135.
- NetBIOS/IP TCP, UDP Port 137-139.
- SMB/IP TCP Port 445.
- Trivial File Transfer Protocol (TFTP) UDP Port 69.
- System log UDP Port 514.
- Select Port Forwarding link.
- Enter the port number to forward.
- From the Protocol dropdown list, select the suitable protocol (TCP/UDP).
- Enter the device's IP address to forward the port to.
- Click on the Destination Port button.
- Reboot your router.