Win7 64-bit system installation configuration php5.6+apache2.4 Environment

Source: Internet
Author: User
Tags vc9 win32 zip port number

One: the preparation stage

1:php

php-5.5.13 Download Link: http://windows.php.net/downloads/releases/php-5.5.13-Win32-VC11-x64.zip

It is recommended that thread safe (thread safety) V11 x64, which is 64bit.

Now PHP official online download PHP installation package has VC11 or VC9 words, this is what meaning, we should download which kind of installation package better?

In fact, the PHP official website gives the answer:

VC9 and VC11

More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and compiler) and include Imp Rovements in performance and stability.

The VC9 builds require you to have the Visual C + + redistributable for Visual Studio 2008 SP1 or x86 x64.

The VC11 builds require to have the Visual C + + redistributable for Visual Studio x86 or x64.

VC9 means that this version of PHP is compiled with VisualStudio2008, and VC11 is compiled with VisualStudio2012. This means

If you are downloading the VC9 version, you need to install VISUALC++REDISTRIBUTABLEFORVISUALSTUDIO2008SP1 first,

If you are downloading a VC11 version, you need to install visualc++redistributableforvisualstudio2012 first.

V11 is a Microsoft component that prompts Msvcr110.dll to be lost if it is not installed.

Download Link: http://www.microsoft.com/zh-CN/download/details.aspx?id=30679

Please download the 64bit, after the installation is complete, please reboot the computer

2:apache2.4.9, download Link: http://www.apachelounge.com/download/

The same is recommended v11,64 bit.

3:mysql 5.6.19, download link: http://dev.mysql.com/downloads/mysql/

The same is recommended Mysql-5.6.19-winx64.zip

Two: Methods/steps

1: Installation configuration Apache2.4.9 (Httpd-2.4.9-win64-vc11.zip)

Unpack the downloaded installation package: Httpd-2.4.9-win64-vc11.zip put it in your own installation directory (my directory E:\Apache24)

Then modify the http.conf (E:\Apache24\conf\http.conf) profile--use Notepad to open the line

(1) Modify the root path of ServerRoot Apache:

(37 lines) ServerRoot "C:/apache24" changed into =>serverroot "E:/apache24"

(2) modify servername your host name:

(217 lines) servernamewww.example.com:80 to remove the front #, which is needed when you start Apache from the command line.

(3) Modify DocumentRoot Apache access to the home folder directory, is the PHP, HTML code file location. The default path for Apache is under Htdocs (E:\Apache24\htdocs), which has a simple entry file index.html. This path can be modified on its own, and I am here to configure it under my own new folder www (E:\php\www).

(247 lines) DocumentRoot "C:/apache24/htdocs"

<directory "C:/apache24/htdocs" >

Change to =>

DocumentRoot "E:\php\www"

<directory "E:\php\www" >

(4) Modify the Portal file configuration: DirectoryIndex In general, we are index.php, index.html, index.htm as the portal for Web projects. Apache default entrance only index.html need to add two other support, of course, this entry file can be set up according to their own needs, if more stringent requirements can only write a index.php, so the entry inside the project is only index.php

(274 lines) <IfModuledir_module>

Directoryindexindex.html

</IfModule>

Change to =>

<IfModuledir_module>

DirectoryIndex index.php index.htm index.html

</IfModule>

(5) Set the Serverscript directory:

(358 lines) scriptalias/cgi-bin/"c:/apache24/cgi-bin/" changed to => scriptalias/cgi-bin/"E:/apache24/cgi-bin"

(6) (374 lines)

<directory "C:/apache24/cgi-bin" >

AllowOverride None

Options None

Require all granted

</Directory>

Change to =>

<directory "E:/apache24/cgi-bin" >

AllowOverride None

Options None

Require all granted

</Directory>

Then you can start Apache.

Start---Run, enter cmd, and open the command prompt. Then enter the E:\Apache24\bin directory under the return httpd carriage return,

If there is no error, you can test it (keep the command window open).

Put the index.html in the Apache24\htdocs directory under the E:\php\www directory, with the browser access will appear "It works" so that the Apache has been properly installed and started. You can also write a simple index.html file that you can also open.

Description: Apache uses 80 ports by default, if 80 ports are occupied, Apache will not start, you can change the Apache port to resolve this issue.

Change port: Locate the httpd.conf file (that is, e:\Apache24\conf\httpd.conf) under the Conf directory under the Apache installation directory. Open it.  Find "Listen80", followed by the Listen number is the port number, we changed to "Listen 8080." It is also ok to modify to another unused port number ... Restart Apache for the new configuration to take effect. You can use Apache serive Monitor, the status bar in the lower right corner, to start Apache. You can also click "Start" > "Run > Enter cmd> carriage return > Navigate to the Apache installation directory to the bin directory, and then enter" Httpd–k start ".

Add Apache to Window service startup and set to boot

Turn off the httpd service first (Close the command window)

Reopen a new command window into the E:\Apache24\bin directory:

The command to add the HTTP service is: Httpd.exe-kinstall-n "ServiceName" ServiceName is the name of the service, I added: Httpd.exe-k install-n "Apache24" The command succeeds with a successful prompt, and you can see Apache24 This service in the window service startup

or (e:\apache24\bin\httpd.exe-k install)

At this point if you appear: Installing the Apache2.4 Service (OS 5) denies access. : ah00369:failed to open the WinNT Service Manager, perhaps your forgot to log in as adminstrator? This error is because when you install Apache, the download is a zip format, not an MSI installation version, you need to register the service, in order to have a httpd icon in the desktop taskbar. Results in the CMD command line entered the installation Service command error, error, error message prompts me not to log in as an administrator!

Solution: Will cmd run as an administrator, and then re-enter the command, after the successful execution, can be found in the system services APACHE24 this service.

Then click to start on it, if you do not want to set up to boot, you can change the startup type to Manual.

If you want to uninstall this service, first stop the service, and then enter Httpd.exe-k uninstall-n "Apache24" Uninstall the service.

Of course, you can also use the ApacheMonitor.exe below E:\Apache24\bin to start Apache, and here's not much to say.

So the Apache configuration is basically done.

2: Installation configuration php5.5.13 (Php-5.5.13-win32-vc11-x64.zip)

(1), will download the Php-5.5.10-win32-vc11-x64.zip to the installation directory under my is (D:\phpEnv\php)

(2) A copy of the Php.ini-development file in the directory and renamed to PHP.ini he is a PHP configuration file

(3), add PHP support for Apache service

Open the Apache configuration file http.conf at the end Plus

# PHP5 Support

LoadModule Php5_module E:/php/php5apache2_4.dll

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

# Configure Thepath to PHP.ini

Phpinidir "e:/php"

Here I add under LoadModule

When you add, make sure that your Php5apache2_4.dll file exists in the earlier version of php5.5 there is no such file, but the high point version is already available, you can open the PHP installation directory to find this file

Phpinidir "e:/php" This is your PHP root directory.

(4). Reboot the Apache server.

(5). Test. Delete other files in www, create a new index.php, the content is <?php phpinfo (),?> Save, access to the presence of PHP information to explain that PHP has been successfully installed.


Note:

Some common configuration modifications for PHP: (E:\php\php.ini)

Time zone settings: Date.timezone = Asia/shanghai

Error Reporting level: Error_reporting = E_all This can be all opened in development mode.

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.