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: http://download.csdn.net/download/ chang87812/7175961

Download PHP: The same I began to download the latest version of the website (website: (http://windows.php.net/downloads/releases/)

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 is: To reinstall the Vcredist_x86.exe, which I installed before the installation of Apache, the file may have been rewritten, so can not find. I also looked online: in 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 put it under System32, 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 started to follow my own understanding of the installation of the VC++2010 runtime, but no matter how debugging is the error, then I downloaded from the Internet the highest version of the vc++2012 Run library, a success. (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: http://download.csdn.net/download/tonyyxm/5428271

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/mod_vhost_alias.so

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/" set Web page file directory This line modifies the line with the # This should is changed to the whatever you set DocumentRoot The 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

FIX: preface: Apache can run, but see Error.log 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 occupied 80 port
Start-run--cmd enter command prompt input Netstat-ano can see all the connected PID Then find the program in Task Manager that corresponds to the PID. If the task Manager does not have a PID, you can select "View"-"Choose Column" in Task Manager
Often, when we launch the application, we find that the port the system needs is occupied by another program, how to know who owns the port we need, A lot of people are more headache, here is a very simple method, I hope to be useful to everyone
if we need to determine who occupies our 80 port
1, Windows platform
in Windows command Line window execution:
C:\>netstat- Aon|findstr
TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 2448
See, the 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 to see which process is 2448, And then kill it.
If you need to see additional ports. Change the 80 to
Add: The original cause of this error (httpd.exe:Could not reliably determine the server ' s fully qualified domain name, using 192.168 .1.111 for ServerName) is because DNS is not configured properly. If you do not want to configure DNS, at httpd.conf, add ServerName localhost:80 to the front

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 0.0.0.0:80 "

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

  • Related Article

    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.