0

I have just installed the XAMPP software few days ago and I'm excited to use it. The installation went pretty well. When it was finished, I opened the XAMPP software.

I was pretty worried of the messages appearing on XAMPP software. These messages look like this:

(Picture1)

To make things right, I first attempted to repair the error involving Apache. The error looked like this:

8:33:34 PM  [Apache]    Problem detected!
8:33:34 PM  [Apache]    Port 80 in use by "Unable to open process" with PID 4!
8:33:34 PM  [Apache]    Apache WILL NOT start without the configured ports free!
8:33:34 PM  [Apache]    You need to uninstall/disable/reconfigure the blocking application
8:33:34 PM  [Apache]    or reconfigure Apache and the Control Panel to listen on a different port

I searched for some answers in Internet and I found how to repair the error in Apache above.

My Attempts

The first solution looks like this, from this Stack overflow question (XAMPP - Port 80 in use by "Unable to open process" with PID 4! 12)

(Picture3)

I was able to follow it, but the problem is the error still appears on the XAMPP, presumably because I wasn't able to find the software named "World Wide Web Publishing Service" and the highest-voted comment hinted on disabling the "SQL Server Reporting Service(MSSQLSERVER)", which involves looking in Visual Studio (I had the Visual Studio 2012 Ultimate) which can make my laptop very laggy, finding the SQL Server data tools futile, and presents too many processes and clicks.

The command "net stop was /y" didn't work because I was shown an error encircled below:

(Picture5.1.1)

The second solution looks like this:

(Picture4)

I was able to follow it. I was able to find the term "Listen 80" on the text file and I changed it to "Listen 8080" and the term "localhost:80" and I changed it to "localhost:8080".

I found the "Listen 80" keyword that should be changed to "Listen 8080" (look at the "Listen 8080" word highlighted in blue)

(Picture5.1)

I found the "localhost:80" keyword that should be changed to "localhost 8080" (look at the "localhost 8080" word highlighted in blue)

(Picture5.2)

I closed the XAMPP software and opened the said software. I was relieved because the I can only see the error involving MySQL. But when I clicked on the "Start" button on the "Apache", a new error appears, which I'm going to solve in the near future. The new error is enclosed in a red box below:

(Problem6)

Now, I partially solved my problem regarding "Port 80 in use by "Unable to open process" with PID 4!" error, but it hasn't end because I get a new error.

Now we turn on attempting to repair the error involving MySQL. The error looked like this:

9:56:28 PM  [mysql]     Problem detected!
9:56:28 PM  [mysql]     Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!
9:56:28 PM  [mysql]     MySQL WILL NOT start without the configured ports free!
9:56:28 PM  [mysql]     You need to uninstall/disable/reconfigure the blocking application
9:56:28 PM  [mysql]     or reconfigure MySQL and the Control Panel to listen on a different port

I searched for some answers in Internet and I found how to repair the error in MySQL above.

My Attempts

The first solution looks like this, from this Stack overflow question: (xampp MySQL does not start)

(Picture7)

I was able to follow it, but the problem is the error still appear on the XAMPP. I don't know where I messed up. I found the my.ini file in an unexpected place as shown encircled in red.

(Problem8)

Then I followed the solution stated. I changed the port 3306 into 3307 in the my.ini file. I changed it in this part of the file (Shown being highlighted in blue).

(Problem9)

I closed the XAMPP software and opened it again. Surprise, surprise, the same error was still there on start-up.

When I tried the alternate way to find the my.ini file to change the port number from 3306 to 3307 by following the path folders (by default, it is xampp\php\php.ini). I installed the XAMPP software on drive D because it has much free space there. So I followed the path folders and I'm disappointed, because there were TWO ini files as shown below.

(Problem9.1)

What would I do to this two php.ini files? I won't dare touch them.

The second solution looks like this:

(Picture10)

It's almost similar to the alternative solution preceded, so it's pretty useless.

My question is:

How do we correct the error

"Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!" 

if the preceding solutions that worked on others doesn't work on me? Am I facing a unique situation?

Fitzmerl Duron
  • 109
  • 1
  • 2
  • 10
  • It's quite hard to follow which services are running and which ports they are trying to use from this write up. Try to make a list of which services are using which ports, and stop ones that clash - either from a prompt or from services.msc. The restart them. – doctorlove Oct 23 '18 at 15:25
  • Change apache port – Mawia HL Oct 23 '18 at 15:33
  • Open a command window (or PowerShell console) and type `netstat -ano`. This will list each port in LISTENING, with the PID of the process holding it. Then look at why port 3306 is used by the identified software. The PID can be referenced in the task manager. It almost looks like you have two installations of XAMP fighting over ports... Oh and for future questions, put what you did in a summary text, no need to screenprint other questions. – Nic3500 Oct 23 '18 at 15:52
  • @Nic3500 I did opened the command window and typed "netstat -ano" and I see the LISTENING and the PID part. But I don't see a software that is using port 3306 when I typed the "netstat -ano" in the command prompt. I didn't understand the meaning of "The PID can be referenced in the task manager." How do we do that? And....yeah...I had the XAMPP software before but it was old version and I uninstalled it. I installed the new XAMPP software few days ago. – Fitzmerl Duron Oct 24 '18 at 13:42
  • @MawiaHL I did. It didn't work. – Fitzmerl Duron Oct 24 '18 at 13:43
  • @doctorlove Hmmm...pretty difficult....I was able to identify few softwares that uses port 3306, but I'm sure there are many softwares that uses port 3306 and I think most of them are hidden from our view. Who knows that an Open Office or Adobe Acrobat Reader or uTorrent might be using port 3306? – Fitzmerl Duron Oct 24 '18 at 13:47
  • That's why @Nic3500 suggested `netstat` – doctorlove Oct 24 '18 at 14:06
  • @Nic3500 I think I understand what "The PID can be referenced in the task manager." meant. Task manager shows the list of programs that had that particular PID. In this case, I only see one program that has the PID of "4", and it is named as System. Should I disable it to free the port 3306? – Fitzmerl Duron Oct 24 '18 at 14:41
  • @doctorlove I think I partially understood Nic3500. The "netstat" command shows you the LISTENING and the PID while the Task Manager shows a program and its corresponding PID. Now its just a matter of disabling programs having the PID of 4 so we can free up the port 3306 so I can finally use the XAMPP... – Fitzmerl Duron Oct 24 '18 at 14:43
  • You can look at: https://stackoverflow.com/questions/6136389/cant-start-mysql-port-3306-busy. Users have had this issue before, it might apply to your case as well. – Nic3500 Oct 24 '18 at 17:19
  • @Nic3500 Hey Nic, I found the answer! Thanks for helping me out man! You can read my answer if you like....:-) – Fitzmerl Duron Oct 30 '18 at 14:58
  • @doctorlove Hey doc, I found the answer! Thanks for helping me out man! You can read my answer if you like....:-) – Fitzmerl Duron Oct 30 '18 at 14:58

3 Answers3

3

After a couple times downloading and installing, and uninstalling the XAMPP three times while looking for answers (In the fourth time I downloaded and installed the XAMPP software, everything now works probably due to my prior troubleshooting efforts), I may now present to you how I was able to repair the error shown below.

"Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!"

The solution was to uninstall the three software indicated in the picture below.

enter image description here

I never used them...probably other people had downloaded it.

And perhaps my prior troubleshooting efforts I've done in the question probably helped to solved my problem.

Now, after you uninstalled those three pesky softwares, always start the XAMPP software in Administrator mode as shown below.

enter image description here

When you see the XAMPP opened, you should see something like this. No red letters.

enter image description here

Do not mind about the Tomcat part. I currently don't need it.....

Hope it helps you...:-)

Fitzmerl Duron
  • 109
  • 1
  • 2
  • 10
  • 1
    in my case, I had not to uninstalled these software, but these software were running my background so I had to end the task and its work for me – K.S Jan 28 '20 at 12:23
0

Port 3306 in use by "Unable to open process"! MySQL WILL NOT start without the configured ports free! You need to uninstall/disable/reconfigure the blocking application or reconfigure MySQL and the Control Panel to listen on a different port

I had this one, and the solution was to open my.init file and simply change port name from 3306 to 3307 on 2 instances.

0

end sql programs on task manager and restart xampp. It works for me.