Win7 64-bit system configuration PHP latest Version development Environment (PHP+APACHE+MYSQL), win7apache_php tutorial

Source: Internet
Author: User
Tags configuration php php development environment php latest version phpinfo vc9

Win7 64-bit system configuration PHP latest Version development Environment (PHP+APACHE+MYSQL), Win7apache


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 has 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"

 

Change to =

DocumentRoot "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)

Directoryindexindex.html

Change to =

DirectoryIndex index.php index.htm index.html

(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)

AllowOverride None

Options None

Require all granted

Change to =

AllowOverride None

Options None

Require all granted

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.


64-bit Win7 flagship build APACHE+PHP+MYSQL development environment

Building a PHP development environment
1. Building under Windows
Windows+php+mysql+phpmyadmin =>wamp
In Linux
linux+apache+mysql+php =>lamp

2. Kit Installation
Appserver Thai man Apache+mysql+php+phpmyadmin
Custom Installation: You can choose the version of each software according to the development requirement; apache+mysql+php+phpmyadmin
Installed in the same folder, easy to manage (folder not with Chinese), install a test one
① Installing Apache
After the end of localhost
② Install PHP Core Pack (Apache----&GT;VC6 version of IIS----&GT;VC9 version), unzip it
③ Integrating Apache and PHP
A. Add the following code to the apache/conf/httpd.conf
#让apache载入php处理模块
LoadModule php5_module PHP installation directory/php5apache2_2.dll
#指定php的ini文件, this file is some configuration of PHP
Phpinidir ' PHP installation directory '
AddType application/x-httpd-php. php. phtml
B. Change the php.ini-development file under PHP to php.ini because the PHP settings need to be modified in php.ini
C. Specify the corresponding function module in the php.ini
Specify the extension library path for PHP here.
extension_dir= "PHP Installation path/ext"
Session.save_path = Remove the front;
and set the path "PHP installation path/session_temp" and create a new folder under the path session_temp
D. Testing
Write text.php under the Apache/htdocs
localhost/text.php
④ installing MySQL
A. Write A piece of code to test for success
$conn =mysql_connect ("localhost", "root", "root");
If ($conn) {
Echo "Connect to the database successfully!" ";
}else{
Echo "Failed to connect to the database! ";
}
?>
Enable the MySQL feature in php.ini
Extension=php_mysql.dll
Extension=php_mysqli.dll

B. Install a phpmyadmin to see if you can use
Unzip phpMyAdmin to Apache/htdocs
Visit localhost/phpmyadmin/index.php ... Remaining full text >>

64-bit Win7 How to configure the apache+mysql+php

Separate configuration of these three things very troublesome, recommended landlord with Wampserver. This is an integrated development environment. After installation, you will have apache+mysql+php, and you do not need any configuration, you can use it immediately after loading. Simple + practical! Highly recommended!

Baidu Search can download!

http://www.bkjia.com/PHPjc/864480.html www.bkjia.com true http://www.bkjia.com/PHPjc/864480.html techarticle Win7 64-bit system configuration PHP latest development environment (PHP+APACHE+MYSQL), Win7apache: Preparation stage 1:php php-5.5.13 download Link: http://windows.php.net/ Downloads/releases/ph ...

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