Win7 64-bit Php-5.5.13+apache 2.4.9+mysql-5.6.19 configuration

Source: Internet
Author: User
Tags vc9

Note: This article is reproduced to http://www.cnblogs.com/isyouth/p/3778045.html

One: Preparation phase

1:php

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

Recommended thread safe (thread safety) V11 x64, which is 64bit.

Now PHP official Download PHP installation package has VC11 or VC9 words, what does this mean, 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 is built with VC9 or VC11 (Visual Studio, and compiler respectively) and include Imp Rovements in performance and stability.

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

The VC11 builds require to has the Visual C + + redistributable for visual Studio , x86 or x64 installed.

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

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

If you downloaded the VC11 version, you will need to install visualc++redistributableforvisualstudio2012 first.

V11 is a component of Microsoft, if not installed, it will prompt Msvcr110.dll lost.

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

Please download 64bit, restart the computer after the installation is complete

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

It is also recommended for v11,64 bit.

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

It is also recommended Mysql-5.6.19-winx64.zip

II: Methods/Steps

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

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

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

(1) Modify the root path of the ServerRoot Apache:

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

(2) modify servername your host name:

(217 lines) SERVERNAMEWWW.EXAMPLE.COM:80 removes the previous #, which is required when launching Apache from the command line.

(3) modify DocumentRoot Apache access to the home folder directory, is the location of PHP, HTML code files. Apache default path is under Htdocs (E:\Apache24\htdocs), there will be a simple entry file index.html. This path can be modified on its own, and I will configure it in 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 generally we are index.php, index.html, index.htm as the portal for Web projects. Apache Default portal only index.html need to add the other two support, of course, the settings of this portal file can be increased or decreased according to their own needs, if the requirements are more stringent can only write a index.php, so that the entry in the project can only be 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/" 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 we can launch Apache.

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

You can test without an error (Keep the command window open).

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

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

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

Add Apache to the window service startup entry and set it to boot

Close 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" After the command succeeds, you will be prompted to see the Apache24 Service in the Window service startup item.

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 do forgot to log in as adminstrator? This error, because when installing Apache, the download is the ZIP format, not the MSI installation version, you need to register the service, in order to have the httpd icon in the desktop task bar. Results in the cmd command line to enter the installation Service command error, error error, error message that I am not logged in as an administrator!

Solution: Run cmd as an administrator and then re-enter the command, and after successful execution, you can find the APACHE24 service in the system service.

Then click on to start, if you do not want to set up the boot, you can also modify 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" to uninstall the service.

Of course, you can also start Apache by E:\Apache24\bin the ApacheMonitor.exe below, and there'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), extract the downloaded php-5.5.10-win32-vc11-x64.zip to the installation directory mine is (D:\phpEnv\php)

(2), copy the Php.ini-development file under the directory and rename it to php.ini he is a PHP configuration file

(3), add PHP support for Apache service

Open Apache configuration file http.conf at the end of the add

# 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 below the LoadModule

Add the time to ensure that your Php5apache2_4.dll file does exist php5.5 earlier version of the file does not have this, 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). Restart the Apache server.

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

Note:

Some common configuration changes in PHP: (E:\php\php.ini)

Settings for time zone: Date.timezone = Asia/shanghai

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

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.