The Apache server cannot use the solution

  • 2020-06-01 08:54:14
  • OfStack

The reason is that port 1:800 is occupied, such as IIS, and the other reason is thunderbolt. My apache server was disabled by thunderbolt!

Reason 2: software conflict. Installing some software will prevent apache from starting if you have an Dr.com network connection open - > TcpIp properties - > Advanced - > The WINS tag removes the lmhosts check from netbios and disables tcp/ip netbios. Then it should start again.


If the configuration file for apache, httpd.conf, is wrong, launch it in windows and it will prompt the requested operation has failed. You can actually launch apache in command line mode, with a parameter, and apache will tell you which sentence is wrong, and then you can fix it accordingly.

Error checking method

Go to cmd and then go to the Apache installation directory (your own installation directory)\bin > httpd. exe-w-n "Apache2" -k start (change Apache2 in quotes to your Apache service name, mine is version 2.2.4, Apache2, you can look it up in computer services)

Prompt if line 133 has a problem (hint :Syntax error on line of 133...) Open the Apache installation directory \conf\ httpd.conf find the ServerAdmin at line 133 (if there is no tool to determine the number of lines, press ctrl+F and search with the "ServerAdmin" keyword, there will be two of them in line 1, the one below).

If port is occupied (note: OS 10048) normally only one socket address (protocol/network address/port) is allowed. , exit Apache, search Listen 80 in httpd.conf, change 80 to 8080 or another port number, and rerun Apache 1, this should be able to start.

Site root directory Settings are not correct


If the root of the website is not set correctly, it will not start. Apache has a lot of things. There are two things. Just look for Apache/htdocs in httpd.conf, as in K:/IDDCWEB/wwwroot. 1 the "\" of the general file address should be changed to "/" in Apache. If you are using Apache2.24, select php5apache2_2.dll to load.

In addition, I will modify some Settings of httpd.conf for your reference and comparison.

1. Change the root directory of the website, there are two places. Find DocumentRoot and Directory. Just modify them, such as D:/wwwroot; In Apache, the word "/" should be changed to "/".

2. Home page setting, DirectoryIndex, add relevant home page items, such as index.php ihdex.htm

3. Look for LoadModule ssl and add two lines below, line 1 "LoadModule php5_module". D: / Server php/php5apache2_2 dll "refers to loading php module way, line 2" PHPIniDir "D: / php" "is indicated php php configuration file. The ini position, is, of course, the" D: / php "to change your previous choice php unzipped directory.

4. Find AddType application/ x-gzip.gz.tgz and add "AddType application/ x-httpd.php" and "AddType application/ x-php.html" at the bottom. You can also add more. For example, if you add 1 line "AddType application/ x-httpd-php.htm", then the.htm file can also execute the php program. You can even add 1 line "AddType application/ x-httpd-php.txt", so that the normal text file format can also run the php program.

5. Search ServerName to change the port after the modified website name to the port previously changed. If not, omit it.


D:\Program Files\Apache2.2\bin > httpd - t. [Wed Jun 22 14:34:49 2011] [warn] module php5_module is already loaded, 503 of skipping Syntax error on line D: / Program Files/Apache2. 2 / conf httpd. conf:
PHPINIDir takes one argument, Directory containing the php.ini file. This is very simple, use notepad to open the "D: / Program Files/Apache2. 2 / conf httpd. conf", do you see the bottom lines have a 【 PHPIniDir ""]. The error was due to the missing parameter in the double quotes.

Solutions:
Find your php installation directory, such as my D: / Program Files/PHP, you only need to in the above double quotes to join "D: / Program Files/PHP/php ini"


Related articles: