How to install php apache in windows

Source: Internet
Author: User
Tags vc9 fully qualified domain name

How to install php apache in windows

One year later, I had to install apache + php again, and I had a new understanding of php.

I took notes during last year's installation: http://blog.csdn.net/monkey7777/article/details/9261325.

For detailed configuration courses, refer to the above notes.

Now write down several problems that may occur during the installation process:


1. An error occurred while starting apache: httpd: cocould not reliably determine the server's fully qualified domain name

I understand this problem as a port. (Port occupation, similar problems with port conflicts)

One way is to find "Listen" in the httpd. conf file of apache and modify its port value.

Another method is to find the process that currently occupies the port and kill the process.

Find port usage:

netstat -ano|findstr "8080"
View the processes using this port: ("x" is the process number)
tasklist|findstr "x"

End a process: ("x" is the process number)

tskill "x"

Because my tomcat uses port 8088 and iis uses port 8080, I changed the Listen value to 8090 to solve the problem.


If neither of the above methods is solved (it should be a DNS configuration problem), you can add a sentence in httpd. conf (Add "ServerName localhost: 8090", the location is as follows ):

#ServerName www.example.com:80ServerName localhost:80


2. When Apache is started, the system prompts "Cannot load php5apache2_4.dll into server"

I downloaded the latest version of php (php-5.5.15-Win32-VC11-x64 ).

In httpd. conf, there is one sentence: (this line of error is displayed when an error is reported)

LoadModule php5_module "c:\php\php5apache2_4.dll"

The first idea of this problem is to replace php5apache2_2.dll with php5apache2_4.dll, which proves to have failed.

I searched the internet for the following reasons: Version problems.

Note that the php name is marked with VC9 and VC11. Indicates the VC compiling environment in which the php should run. (After all, this is something written in C ++ ...)

My understanding is that VC9 should run in the Runtime Library with VC2008, and VC11 should be in the Runtime Library with VC2012. However, after installing the 2012 Runtime Library, I found that it still cannot run correctly. With the god of light to the php-5.3.6-Win32-VC9-x64 (inside is php5apache2_2.dll), after the configuration is good run OK.

Http://windows.php.net/the official website is as follows:

VC9 and VC11More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and 2012 compiler respectively) and include improvements in performance and stability.The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed.
It means that VC9 and VC11 respectively need a specific compiling environment. VC9 --> VC2008, VC11 --> VC2012.


This is a saying on the Internet. "Because of the different apache versions, the corresponding" php5apache2. dll "is also different ". It means that the apache and php versions are related to each other.

That is:

Apache2.2 corresponds to php5apache2_2.dllApache2.1 corresponds to php5apache2. dllApache1 corresponds to php5apache. dll
But I think there should be no corresponding relationship. After all, I did not say it on the official website.

However, the php version of VC11 is not easy to use after I installed the VC2012 Runtime library. I can only doubt that the VC2012 Runtime Library is not installed or there is a corresponding relationship.

If the environment is okay, try the corresponding relationship.

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.