How to configure the PHP Web environment under Windows 7

Source: Internet
Author: User
Tags benchmark character set html page openssl php website win32 mysql database phpmyadmin

This article is suitable for the PHP website technical development personnel, to the ordinary Windows7 user significance is not big, please everybody attention. First, Apache installation

Version explanation: OpenSSL is a OpenSSL module that uses OpenSSL to configure SSL security links to Apache, which is accessed using the https://method.

Nossl means that the OpenSSL module is not available for SSL security links, where we download the OpenSSL.

Select version: Apache_2.2.14-win32-x86-openssl-0.9.8k.msi (This is a 32-digit example)

Download Address: http://www.apache.org/dist/httpd/binaries/win32/

First we create a new directory on D disk (the letter is chosen according to the actual situation), and some content that is named "WAMP" after the meaning of "wdindows Apache Mysql phpMyAdmin" will also be installed in the directory.

1. Installation Instructions:

Running the Apache installer is very simple, "next" after the installation interface

Then there will be an interface, you need to fill out 3 content, respectively: Network Domain, Server Name, Administrator ' s Email address casually fill in the good, do not affect the content.

There are 2 options below, the default selection is 80 port, the second is 8080 port, according to personal requirements, generally the default 80 ports.

We continue with the installation, select Custom (customized installation)-"Next"

Where there are components with red X, we click on this component to select "This feature, and all subfeatures,"

Installed on the local hard drive., that is, "this section, and subordinate parts, are all installed on your hard disk." -"Next"

Then select "Change" in the lower right corner to alter the installation path and install the "D:wampapache"-"Next" in the directory you just created.

After installation, the lower right corner of the computer will be an icon, double-click Open, select Start or restart, can run normally, this installation is complete.

2. Modify the configuration:

Open the D:wampapacheconfhttpd.conf file (when modifying the configuration file, it is not recommended to use Notepad, it may affect it, it is recommended to use notepad++ or other editing software to open the modification)

After opening ctrl+f Find what you want to modify

Add under #loadmodule vhost_alias_module modules/mod_vhost_alias.so:

LoadModule php5_module "D:/wamp/php/php5apache2_2.dll"

Phpinidir "d:/wamp/php"

AddType application/x-httpd-php. php

AddType application/x-httpd-php. htm

AddType application/x-httpd-php. html

DocumentRoot "E:/wamp/apache/htdocs"

Modified to (the path here is the same as the Wwwroot directory in IIS, for storing web pages, customizing or not modifying the default): DocumentRoot "D:/wamp/www"

Modify to (custom or do not modify default):

DirectoryIndex index.html

Modified into: DirectoryIndex index.php default.php index.html index.htm default.html

3. Test

Create a index.html page in the D:/wamp/www directory

Enter http://localhost/in the browser

If the normal display, Apache configuration completed, has been normal operation.

Second, MySQL installation

Version explanation: The Essentials Package: The embedded server and benchmark suite is not included, there is an automatic installer and Configuration Wizard, and there is no MySQL documentation.

The Complete Package: contains the embedded server and benchmark suite with the Automatic Installer and Configuration Wizard, with MySQL documentation.

The Noinstall Archive: contains the embedded server and benchmark suite, there is no automatic installer and Configuration Wizard, there is a MySQL documentation.

Select version: Mysql-essential-5.1.44-win32.msi

Download Address: http://www.mysql.com/downloads/mysql/

1. Installation Instructions:

Open the installer and click Next

Select Custom, the component is the default selection, we do not make changes-"next"

The path is set to "D:wampmysql"-"Next"

After installation, click "Finish"

Then a configuration wizard appears-"Next"

Select "Detailed Configuration (Detailed configuration)"-"Next"

Here are 3 options:

Developer Machine will only use as little memory as possible;

Server Machine, will use a medium amount of memory;

Dedicated MySQL server Machine, this server only runs the MySQL database, will occupy all the memory.

You can choose from your own needs, here we choose the second "Server Machine"-"Next"

There are also 3 options for choosing a database purpose:

Mutltifunctional database multi-purpose Use, will optimize the databases into a very good innodb storage type and efficient MyISAM storage type;

Transactional Database only for transaction processing type, the best optimization innodb, but also support MyISAM;

Non-transactional Databse Only is a non transactional type, suitable for simple applications, and only myisam types that do not support transactions are supported.

The general choice of the first multi-functional, the same we are. -"Next"

Select INNODDB Data storage location, general default on the line, in order to unify I filled out the "wamp/mysql datafiles"-"Next"

Choose the maximum number of connections that MySQL allows, the first is the maximum 20 connection concurrency, the second is the maximum number of 500 concurrent connections, the last one is customized, you can choose according to the requirements, I choose the second-"Next"

The following is the choice of database listening port, the general default is 3306, if you change to other ports, when you connect the database to remember the modified port, otherwise can not connect MySQL database, more trouble, here do not make changes, with mysq default port: 3306-"Next"

This step sets MySQL's default encoding, we select the third, and in the Character set menu, select "GBK" code-"Next"

(Note: If you want to use the original database data, it is best to determine what the original database is encoded, if the code set here and the original database data encoding inconsistent, in the use of the time may appear garbled. )

This step is to set MySQL as Windows, the general choice to set up a service, so that the MySQL database can be started and closed through the service. The following check box is also checked, so that in cmd mode, you do not have to execute commands under MySQL's Bin directory. Which is to put the top and bottom 2 hooks, the middle default-"next"

This step is to set MySQL's superuser password, this super user is very important, the MySQL has all the permissions, please set and remember the Superuser password, the following check box is to choose whether to allow

Allow remote machine to connect to your MySQL server with root user, if this requirement, also please tick. Here we use the default selection, in the new root

Enter the password in password and confirm. "Next"

Click "Execute" to configure, a little wait for a while, the tick on the dot all hit, on behalf of the configuration completed.

2. Modify the configuration:

Open D:wampmysqlmy.ini

Set DataDir to d:/wamp/mysql/data/or the directory where you want to store the data.

Three, PHP installation

Version Explanation: VC9 specifically for IIS-defined scripts, compiled with the visual Studio 2008 compiler to support the latest Microsoft set-up to improve efficiency.

VC6 is for other Web services software provided by scripts such as Apache.

Thread safe is ready for safety, and the star will conduct a threaded security check to prevent the need to run out of system resources in the form of CGI execution that initiates a new thread (thread).

Non thread safe is non-threaded and does not carry out thread security checks at execution time

Select version: PHP5.3 (5.3.1) VC6 x86 Thread safe zip download

Download Address: http://windows.php.net/download/

1. Installation Instructions

As we download the ZIP compression package, just extract the file to the "d:wampphp" directory

2. Modify Configuration

Modify the E:wampphpphp.ini-development file to PHP.ini

Open php.ini

; Extension_dir = "ext"

Modified into: Extension_dir = "E:wampphpext"

will be 947 lines below these files in front of the ";" Remove

Extension=php_curl.dll

Extension=php_gd2.dll

Extension=php_mbstring.dll

Extension=php_mysql.dll

Extension=php_mysqli.dll

Extension=php_pdo_mysql.dll

Extension=php_xmlrpc.dll

;d Ate.timezone =

Modified into (many sites do not mention here to modify, the default for the United States time, if not modified will be an error): Date.timezone = Asia/shanghai

3. Test

Reboot Apache (the configuration file has been modified to restart Apache before it takes effect)

Create a new index.php page, enter the code, save the file and put it in the "d:wmapwww" directory

Open Browser Input: http://localhost/index.php If the normal display, the description of the PHP configuration is complete, you can see the page's PHP information is correct.

(Note: In the change file input function can output a lot of information about the current state of PHP, such as PHP version, server information and environment.) )

(Note:)

And then we test if we can connect to MySQL

To create a new link.php, enter the following code

$link =mysql_connect ("127.0.0.1″", "root", "password filled in MySQL when installed");

if (! $link) echo "MySQL database connection failed!";

else echo "MySQL database connection successful!";

Mysql_close ();

?>

Save the file and put it in the "d:wmapwww" directory

Open Browser input: http://localhost/link.php view

Iv. installation of phpMyAdmin

Version Explanation: phpMyAdmin-3.2.5

Select version: Phpmyadmin-3.2.5-all-languages.zip

Download Address: http://www.phpmyadmin.net/home_page/downloads.php

1. Installation Instructions

Extract to D:wampphpmyadmin

2. Modify Configuration

Open d:wampphpmyadminlibrariesconfig.default.php

$cfg [' pmaabsoluteuri '] = ";

Modify to (fill in the absolute URL of the access phpMyAdmin): $cfg [' pmaabsoluteuri '] = ' http://localhost/PHPMyadmin/';

$cfg [' Servers '] [$i] [' host '] = ' localhost ';

Modified to (fill in the server address, usually default, do not need to modify): $cfg [' Servers '] [$i] [' host '] = ' localhost ';

$cfg [' Servers '] [$i] [' user '] = ' root ';

Modified to (fill in the MySQL username, here we default): $cfg [' Servers '] [$i] [' user '] = ' root ';

$cfg [' Servers '] [$i] [' password '] = ";

Modified to (fill in the MySQL password): $cfg [' Servers '] [$i] [' password '] = ' mysql PWD;

$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';

Modify to (Set authentication method, security factor consider, fill into cookie): $cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';

$cfg [' blowfish_secret '] = ";

Modified to (set phrase password, if the above is set to cookies, it can not be left blank, or login will be prompted error): $cfg [' blowfish_secret '] = ' cookie ';

3. Test

Open Browser input: http://localhost/phpmyadmin/Access and Login

V. End

So far Windows7 under the PHP environment has been built, we enjoy the use of it.

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.