Win764-bit Apachehttpserver + PHP configuration

Source: Internet
Author: User
Tags vc9 fully qualified domain name
Win764-bit Apachehttpserver + PHP configuration

1. first download apache http server (I originally wanted to download it from the official website, but I couldn't find it for a long time, so I got an old version online) I downloaded it at this URL: http://download.csdn.net/download/chang87812/7175961

Download PHP: the same I started to download the latest version on the official website (URL: (http://windows.php.net/downloads/releases)

However, after the configuration is completed, there is a problem.

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

The reason is: This file must correspond to the version; otherwise, it cannot be loaded. This prompt appears again later, except that the activation context of "D: \ ApaServ \ php \ php5apache2_4.dll" is generated in the 174 line of php5.4.8. The affiliated assembly vcredist_x86.exe cannot be found. The solution is to re-install vcredist_x86.exe. this is what I installed before installing apache. the file may have been changed, so I cannot find it. I also read the following Files online: in a file similar to C: \ Program Files \ Microsoft Visual Studio 8 \ VC \ redi st \ Debug_NonRedist \ x86 \ Microsoft. VC80.DebugCRT:
Msvcm80d. dll msvcp80d. dll msvcr80d. dll Microsoft. VC80.DebugCRT. manifest copy these files to the target machine and run them in the same folder as the running program or in system32.
All the other release versions and MFC programs can copy the files in the corresponding folder under redist, and the files are marked after the folder!

This prompt is returned.Later, when php5.5 was installed, this error message was prompted. I started to install the VC ++ 2010 Runtime Library according to my own understanding. However, no matter how debugging is performed, this error occurs, later, I downloaded the highest version of the VC ++ 2012 runtime library from the Internet. (This is because I found it online. I have not practiced it. I don't want to install another VC ++ 2012 runtime library !!!)

So I found an old version of PHP on the internet, download URL: http://download.csdn.net/download/tonyyxm/5428271

II. install Apache

1, 64-bit Apache is different from 32-bit package into exe file can be directly installed, the first httpd-2.2.19-win64 to decompress E: /server/apache-httpd-2.2.19-win64/(/* E is the drive letter of the specific server file */)

2. run the command prompt (start-program-attachment) as administrator to enter E:/server/apache-httpd-2.2.19-win64/

3. execute httpd-k install

The following error occurs: failed to open the winNT service manager.

Solution: The software was installed in conflict with Windows 7's "User Account Control" (UAC, you only need to close the UAC (control panel-user account and home security-system and security-Operation Center, which contains "Change User Account Control Settings" and change it to never notice, after the installation is complete, you will be prompted to restart the system. at this time, you need to restart the system. after the installation is complete, you can change it back.

4. modify httpd. conf. the configuration is the same as that in the 32-bit system.

(1) modify ServerRoot "E:/server/httpd-2.2.19-win64 /"

(2) the following shows the functional modules enabled by apache: # LoadModule vhost_alias_module modules/mod_vhost_alias.so

Add the following modules:

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 and find the line DocumentRoot "E:/Code/PHP/" to set the webpage file directory to be modified with the line # This shoshould be changed to whatever you set DocumentRoot Directory settings correspond

5. run httpd-k start at the command prompt again. if no error occurs, the apache service starts successfully.

6. shut down the Apache Server: run httpd-k shutdown.

3. configure PHP

1. as mentioned above, I decompress the php directory to E:/Server/php-5.3.6-Win32-VC9-x64/that corresponds to the LoadModule location set in Apache

2. change php. ini-development to 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, php file directory/ext

4. find the extension list; extension = php_gd2.dll,; extension = php_mysql.dll, and ";" Before extension = php_mysqli.dll to enable the extension. of course, the above extension is used as an example, you can enable the corresponding extension based on different functions.

5. (optional) the value of date. timezone is set to Asia/Shanghai, that is, date. timezone = Asia/Shanghai.

6. create a test. PHP file under E:/Code/PHP/. the content is

Phpinfo ();

?>

Enter http: // localhost/test. php in the address bar of the browser.

The above configuration process is for others: after I configure it, the following two problems occur:

1. httpd: cocould not reliably determine the server's fully qualified

Solution:Although apachecan run, it can be seen that httpd.exe: cocould not reliably determine the server's fully qualified domain name, using 192.168. x. x for ServerName is incorrect in error.log. check whether other port 80 is occupied.
Start -- run -- cmd enter the command prompt and enter netstat-ano. then you can see all connected PIDs and find the program corresponding to the PID in the Task Manager. If no PID exists in the task manager, you can select "View"-"select column" in the task manager"
Often, when we start an application, we find that the ports required by the system are occupied by other programs. how do we know who owns the ports we need, next we will introduce a very simple method and hope it will be useful to you.
If we need to determine who is using port 80
1. Windows Platform
Run the following command in the windows command line window:
C: \> netstat-aon | findstr "80"
TCP 127.0.0.1: 80 0.0.0.0: 0 LISTENING 2448
As you can see, the port is occupied by a process with the process number 2448. continue to execute the following command:
C: \> tasklist | findstr "2448"
Thread.exe 2016 Console 0 16,064 K
Well, thread occupies your port and Kill it.
If you cannot find the process in step 2, open the Task Manager, check which process is 2448, and then kill it.
If you want to view other ports. Change 80.
Supplement: the original cause is: httpd.exe: cocould not reliably determine the server's fully qualified domain name, using 192.168.1.111 for ServerName. if you do not want to configure DNS, go to httpd. conf, add ServerName localhost: 80 at the beginning.

2. "(OS 10013) attempted to access the socket in a way that the access permission is not allowed. : Make_sock: cocould not bind to address 0.0.0.0: 80"

Solution:Change the port, open. \ apache \ conf \ httpd. conf, change all 80 to 81, save and restart apache. OK.

After the port is changed, access from 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: 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.