Win7 64-bit Apache HTTP server+php configuration

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

1, first download Apache HTTP server (I originally wanted to download on the official website, but not found for half a day, so on the Internet under an old version) I was downloaded at this website: chang87812/7175961

Download PHP: The same I began to download the latest version of the website (website: (

But then there was a problem after the configuration.

The problem is: Httpd:syntax error on line 129 of D:/php/server/httpd-2.2-x64/conf/httpd.conf:cannot load d:/apaserv/php/ Php5apache2_4.dll into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3.

This is because this file corresponds to a version, otherwise it cannot be loaded. Later, again, this hint, just replaced by php5.4.8 in 174 rows, "D:\ApaServ\php\php5apache2_4.dll" activation context generation failed. Dependent assembly Vcredist_x86.exe not found. Later the solution was:re-installed the Vcredist_x86.exe, which I installed before installing Apache, possibly the files are changedIt was written, so I couldn't find it. I also watched the online: in a similar C:\Program files\microsoft Visual Studio 8\vc\redi St\debug_nonredist\x86\microsoft.vc80.debugcrt The following files were found:
Msvcm80d.dll msvcp80d.dll msvcr80d.dll Microsoft.VC80.DebugCRT.manifest copy these files to the target machine, and run the program in the same folder or under the System32, it can be run correctly.
Other release version, MFC program is redist under the corresponding folder files can be, folders are marked!

The hint came to mind after that. later, when installing php5.5, I began to follow my own understanding of the installation of the VC++2010 runtime, but no matter how debugging is the error, then I downloaded the highest version of the VC++2012 runtime from the Internet, Success on a second. (This is the reason I found on the Internet, I did not practice, I do not want to install vc++2012 run the library again!!!) )

So I found an older version of PHP on the internet, download URL:

Second, install Apache

1, 64-bit Apache different from 32-bit package into EXE file can be installed directly, first extract Httpd-2.2.19-win64 to e:/server/apache-httpd-2.2.19-win64/(/*e for the specific server file disk drive letter */ )

2. Run command prompt as administrator (start-Programs-attachments), enter e:/server/apache-httpd-2.2.19-win64/

3. Execute httpd-k Install

The problem occurs here: Failed to open the WinNT service Manager

Resolution: The original Software installation with the Windows7 "User Account Control" (UAC) conflict, as long as the first turn off UAC (Control Panel-user account and Family Safety-system and security-operation Center, which has "change user Account Control Settings", changed to never notice, after completion will prompt restart, Need to reboot at this time) and then the installation will be no problem, after the installation can be modified back.

4, modify the httpd.conf, here with the 32-bit system in the same configuration

(1) Modify ServerRoot "e:/server/httpd-2.2.19-win64/"

(2) Below you will see Apache open function modules such as: #LoadModule vhost_alias_module modules/

The module is then added:

LoadModule php5_module "E:/server/php-5.3.6-win32-vc9-x64/php5apache2_2.dll"

Phpinidir "e:/server/php-5.3.6-win32-vc9-x64/"

AddType application/x-httpd-php. html. htm. php

(3) Continue down, find the line DocumentRoot "e:/code/php/" Settings page file directory This line modifies the line with the # This should is changed to the whatever you set DocumentRoot to after <di Rectory "e:/code/php/" > Directory settings correspond

5. Execute httpd-k start again at the command prompt no error that Apache service started successfully

6. Close Apache server: Execute httpd-k shutdown

Third, configure PHP

1, as mentioned above, I extracted the PHP directory to e:/server/php-5.3.6-win32-vc9-x64/that corresponds to the step in Apache set LoadModule location

2, change the php.ini-development into php.ini

3, open php.ini, find Extension_dir, modify its value to e:/server/php-5.3.6-win32-vc9-x64/ext/that is the PHP file in the directory/ext

4, find the extension list, Extension=php_gd2.dll, Extension=php_mysql.dll, extension=php_mysqli.dll ago ";" Remove that is to open the extension, of course, the above extension for example, can be based on the function to open the corresponding extension

5. (optional) The value of Date.timezone is set to Asia/shanghai i.e. Date.timezone =asia/shanghai

6, create a test.php file under e:/code/php/, the content is


Phpinfo ();


Then enter http://localhost/test.php in the browser address bar

The above configuration process is someone else's: when I am well-equipped, the following two questions appear:

1, httpd:could not reliably determine the server ' s fully qualified

Solution:Preface: Although Apache can run, but see Error.log in httpd.exe:Could not reliably determine the server's fully qualified domain name, using 192. 168 x. x for servername This error, want to see if there are other 80 ports occupied
Start-run--cmd Enter the command prompt to enter Netstat-ano to see all the connected PID after the PID in the task Manager to find the corresponding program if the task manager does not have the PID, you can choose "View"-"Select column" in Task Manager
Often, we start the application when the system needs to find the port is occupied by other programs, how to know who owns the port we need, a lot of people are more headache, the following is a very simple method, we hope to be useful
If we need to determine who's taking up our 80 port,
1. Windows platform
Execute under Windows command-line window:
C:\>netstat-aon|findstr "80"
See, Port is occupied by process number 2448 process, continue to execute the following command:
C:\>tasklist|findstr "2448"
Thread.exe Console 0 16,064 K
It's clear that thread is taking up your port, Kill it
If the second step is not found, then open the Task Manager, see which process is 2448, and then kill it.
If you need to see additional ports. You can get rid of 80.
Add: The original cause of this error (httpd.exe:Could not reliably determine the server's fully qualified domain name, using for Se Rvername) is because DNS is not configured properly. If you do not want to configure DNS, in httpd.conf, add ServerName localhost:80 at the top

2, "(OS 10013) made an attempt to access the socket in a manner not permitted by access rights. : Make_sock:could not bind to address "

FIX: change port, open. \apache\conf\httpd.conf, change all 80 of them to 81, save after restarting Apache, OK.

The port will be changed to access the following URL: http://localhost:81/test.php

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: 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.