xampp (apache+mysql+php+perl) is a powerful website building integration software package. Many people know from their own experience that installing an Apache server is not an easy task. If you want to add MySQL, PHP, and Perl, it's even harder. Using xampp, you can easily build a running environment for PHP and other programs under various systems.
Xampp is very simple to obtain and install. You only need to go to the following website:
http://www.apachefriends.org/zh_cn/xampp.html to download xampp. I installed the windows version Installer installation package, just follow its installation prompts to install it, which is very convenient and fast.
However, it is best to choose a disk other than the C drive for the installation directory. According to the experience of some netizens, in Windows 7 or Vista, if you choose the C drive for installation, there will be a problem of failure to create some files due to permission reasons. If you already have the highest authority, you can install it directly on the C drive.
Generally in Windows XP or Windows 7, when xampp is just installed, the apache server cannot be started.
Today, when I used xampp to modify wordpress, I found a serious problem. Apache could not be started. No matter how many times I clicked start, the display was as follows:
busy...
apache started [port 80]
After checking the information from many parties, it turned out that the reason was that port 80 was blocked. Other programs occupy it, so this port is very busy, causing Apache to fail to start. Solution one is as follows:
1. Run -cmd, then enter netstat -ano and press Enter;
2. Check the pid of the line containing xx.xx.xx.xx:80 in the local address. It is a few numbers. Write down these numbers;
3. Start "Task Manager" - "Details", find the corresponding "PID", and "End Task";
4. Then check which program corresponds to the pid just now, It is easy to find, that is, it occupies port 80;
5. Stop it directly or use tools such as Optimization Master to prevent it from starting up.
Okay, it’s ready to use.
Second solution: Change the port (Try not to use ports 0-1023, this is a system reserved port)
The iis server used by my asp is the default web80 port of xp, and the tomcat server used by jsp. It is the default port 8080 when tomcat is installed. Then I will change the default port 80 of apache in xampp under php to 8081 (any other port will be fine as long as it is not occupied). Otherwise, everything else will be ok
In this case, how to modify it What about the apache port? Go to the installation directory of ServerName localhost:8081
Then restart apache in XAMPP Control Panel.
Why is it still displayed as follows:
busy...
apache started [port 80]
Never mind it, enter the address in IE: http://localhost:8081 to test, it cannot be opened, I have modified the apache port. , try to stop the iis web service. Start
apache again. It also displays as follows:
busy…
apache started [port 80]
Enter the address in IE: http://localhost:8081 to test and successfully open the xampp web page. The prompt:
Welcome to XAMPP for Windows Version 1.7.0!
Congratulations You:
You have successfully installed XAMPP!
Although the xampp-control dialog box still shows that apache has started port 80, the actual occupied port is 8081. Restart the iis service, and both apache and iis can work on their respective ports 8081 and 80.
Restart the computer, apache cannot be used again, try to close the iis service, start apache -> http://localhost:8081 test is successful; then start the iis service,
http://localhost:8081 test is successful
It’s really a What a strange debugging process. Anyway, it works.
Start apache directly with xamppapache_start.bat, and a prompt appears that port 443 is occupied. It turns out that IIS occupies the ssl port (that is, port 443 https). This is easy to handle. Modify xamppxamppapacheconfextrahttpd -ssl.conf file, change all 443 to 4433 or turn off the ssl service, test again and everything is ok.
Of course, as a development and debugging environment, if the SSL service is not needed, the SSL service can be turned off. The method is to modify the xamppapacheconfhttpd.conf file, find "Includeconf/extra/httpd-ssl.conf" and comment it out with the # character to turn off the SSL service.
Writing while doing the debugging process of running, indicating that the startup was not successful.
Solution:
1. Start apache in the xampp control panel if the startup fails.
2. Enter the apache directory under the xampp installation directory, such as c:xamppapachelogs
3. You can see an error.log file.
4. Open the file and go to the end of the file to learn more about the reason for the startup failure.
5. Find solutions to different reasons for failure.
Solution to the case
1. Failed to start apache in the xampp control panel
2. Check the error.log, it shows "make_sock: could not bind to address0.0.0.0:80
no listening sockets available shutting down"
3. Yes It seems that this is a mistake when listening to port 80. Maybe port 80 is already occupied by other applications. The failure to start apache is mostly due to port issues.
4. Open the c:xamppapacheconf directory
5. There is a httpd.cnf file in the directory. Open it with Notepad and change all "80" inside to other ports such as "8082". After modification, save and exit.
6. Re-start apache in the xampp control panel. It is successful and the status is running.
Note: Because the default port of the browser is 80, after modifying the listening port of apache, when browsing in the browser, you need to add localhost after port. For example, http://localhost:8082/ replaces the previous http://localhost/. Of course, localhost= 127.0.0.1, the same as http://127.0.0.1:8082/.
The above introduces the solution to the problem that Apache cannot start in Xampp, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn