Windows system Apache, PHP failed to start the problem summary _win server

Source: Internet
Author: User
Tags apache error log php compiler vc9

Frequently asked about Apache's inability to start recently, write an article summarizing the solutions to apache/php that are frequently encountered under Windows.

Apache/php cannot start in two different ways:

1, Apache can not start, did not load PHP can not start
2, Apache can start, but after loading PHP cannot start

The first scenario is mostly Apache configuration issues, or 80 ports are occupied

Use Apache's configuration check:

Copy Code code as follows:

C:\>d:\apache2.2\bin\httpd.exe-t
Syntax OK

Correct the error according to the error message.
if it is 80 port occupancy, this is more common in Windows machines and is often preempted by IIS.

Unregister the IIS service:

Copy Code code as follows:

Iisreset/stop
Iisreset/disable

sc stop W3SVC
SC delete w3svc

If it is not IIS, you can use the command to kill the process of seizing port 80:

Copy Code code as follows:

# Find the process PID that takes up 80 ports
Netstat-ano|find ": 80"

# Assuming that the process PID is 2013, view the process name:
TASKLIST/FI "PID eq 2013"

# Kill the Process command
taskkill/f/pid 2013

If this is not the case, it may be a system network problem, as follows:

Copy Code code as follows:

Setup_inherited_listeners (), WSASocket failed to open the
Inherited socket.

To repair a Windows network by using a command:
Copy Code code as follows:

netsh winsock reset

Restart the machine, and if the problem is not resolved, try the following methods:

Local Connection-> Properties-> Advanced-> wins label-> Remove the tick before the LMHOSTS query is enabled

Copy Code code as follows:

/******** Ruthless split Line *********/
The tree without flowering
/******* Ruthless copy *********/

The second most is the problem with the PHP compiler:

Look at the Apache error log, which is similar to the following:

Copy Code code as follows:

Httpd.exe:Syntax error on line ' D:/apache2.2/conf/httpd.conf:cannot load D:/php/php5apache2_4.dll into server:%1 \ Xb2\xbb\xca\xc7\xd3\xd0\xd0\xa7\xb5\xc4 Win32 \xd3\xa6\xd3\xc3\xb3\xcc\xd0\xf2\xa1\xa3

The compiler used by php5.5 is vc11,php5.4 and php5.3 is vc9,php5.2 is VC6. Also note whether the x86 version or the x64 version. Currently only php5.5 provide x64 version, others are only x86 version.
apache.org download Apache are VC6 versions, otherwise install different runtime libraries according to different file descriptions.

VC11 Runtime x86/x64 version: http://www.microsoft.com/en-us/download/details.aspx?id=30679
VC10 Runtime x86 version: http://www.microsoft.com/en-us/download/details.aspx?id=5555
VC10 Runtime x64 version: http://www.microsoft.com/en-us/download/details.aspx?id=14632
VC9 Runtime x86 version: http://www.microsoft.com/en-us/download/details.aspx?id=5582
VC9 Runtime x64 version: http://www.microsoft.com/en-us/download/details.aspx?id=15336
If you are not aware of your situation, you can install the entire runtime, no longer have to worry about this issue.

If apache/php does not start, it is most likely the problem with the Php5_module module:

1, Apache2.0 corresponding PHP module for the Php5apache2.dll
2, Apache2.2 corresponding PHP module for the Php5apache2_2.dll
3, Apache2.4 corresponding PHP module for the Php5apache2_4.dll

In other words, depending on the Php5_module module, you can tell which Apache the current version of PHP supports

Therefore, the apache/php collocation has the following kinds of situations:

1, php5.2 support Apache2.0 and Apache2.2;
2, php5.3, php5.4 at the same time support Apache2.2 and Apache2.4;
3, php5.5 only support Apache2.4

Unless you compile the Php5_module module manually, there are only 3 options available.

If the apache/php still fails to start, check to see if the PHP configuration (php.ini) is present, and run Php.exe There are no prompts for errors. Correct the error according to the error message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.