How to configure the PHP website runtime environment on Windows 7

Source: Internet
Author: User
In Windows 7, how does one configure the PHP website runtime environment? 1. Apache installation? Version description: openssl indicates that the openssl module is included. with openssl, you can configure an SSL security link for Apache, that is, access through https .? Nossl indicates that the OpenSSL module is not included and cannot be used to configure the PHP website runtime environment in Windows 7.

?

1. Apache installation?

Version description: openssl indicates that the openssl module is included. with openssl, you can configure an SSL security link for Apache, that is, access through https .?
Nossl indicates that the OpenSSL module is not included. it cannot be used for SSL secure links. here we download the OpenSSL module.

Select version: apache_2.2.14-win32-x86-openssl-0.9.8k.msi (32-bit here)
: Http://www.apache.org/dist/httpd/binaries/win32/

First, we will create a directory on the drive D (which is selected based on the actual situation) and name it "WAMP". it indicates the content installed after "Wdindows Apache Mysql PhpMyAdmin, will also be installed in this directory .?

1. Installation instructions:

Run the apache installer. the method is very simple. after the installation interface is displayed, "next"



Next, an interface is displayed. you need to fill in three items: Network Domain, Server Name, and Administrator's Email Address.

There are two options below. the default value is Port 80 and the second value is port 8080. the default value is port 80 .?
To continue the installation, choose Custom (Custom installation)-"next"



There is a red X component. click This component and select "This feature, and all subfeatures, will be installed on local hard drive. ", that is," this part and its sub-parts are all installed on the local hard disk ". -"Next "?

Then select "change" in the lower-right corner to change the installation path and install it in the created directory "D: \ WAMP \ Apache \"-"next "?
After the installation is complete, an icon is displayed in the lower-right corner of the computer. double-click it and select start or restart to run properly. now the installation is complete .?

2. modify the configuration:

Open the installation directory D: \ WAMP \ Apache \ conf \ httpd. conf file (when modifying the configuration file, we do not recommend using Notepad, which may affect it. we recommend using Notepad ++ or other editing software to open the modification )?

After the command is opened, Ctrl + F will be used to find the content to be modified?

Add the following 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 "?
Modify to (the path here is the same as the wwwroot directory in IIS, used to store webpages, customize or do not modify the default): DocumentRoot "D:/WAMP/www "?

Modify to (custom or do not modify the default value ):?

DirectoryIndex index.html?
Changed to: DirectoryIndex index. php default. php index.html index.htm default.html default.htm?

3. test

Create an index.html page under the D:/WAMP/www directory?
Enter http: // localhost/? in the browser /?
If it can be properly displayed, Apache is configured and running properly .?

II. install MySql?

Version description: The essenessenpackage does not contain The embedded server and benchmark suite. it has an automatic installation program and Configuration Wizard, and does not have MySQL Documentation .?
The Complete Package: includes The embedded server and benchmark suite, automatic installation program and Configuration Wizard, and MySQL Documentation .?
The Noinstall Archive: contains The embedded server and benchmark suite. there is no automatic installation program and Configuration Wizard, and there is MySQL Documentation .?
Select version: mysql-essential-5.1.44-win32.msi?
: Http://www.mysql.com/downloads/mysql?

1. Installation Instructions :?
Open the installer and click "next "?
Select custom. the default component is selected. do not change-"next "?

Path: "D: \ WAMP \ Mysql"-"next "?

After installation, click "finish "?
A configuration wizard-"next "?

Select "Detailed Configuration (Detailed Configuration)"-"next "?

There are three options:

Developer Machine, which uses as little memory as possible ;?
Server Machine, which uses a moderate amount of memory ;?
Dedicated MySQL Server Machine. This Server only runs mysql databases and occupies all the memory .?
You can choose as needed. here we choose the second "Server Machine"-"next "?

Select the database purpose. There are also three options:

Mutltifunctional Database multi-functional purposes, will optimize the Database into a good innodb storage type and an efficient myisam storage type ;?
Transactional Database is Only used for transaction processing. it is best to optimize innodb, but it also supports myisam ;?
Non-Transactional Databse Only is a Non-transaction processing type and is suitable for simple applications. Only the myisam type that does not support transactions is supported .?
Generally, we choose the first type of function. -"Next "?

Select the data storage location of InnodDB, which is generally the default. to ensure consistency, I entered "WAMP/MySQL Datafiles"-"next "?

Select the maximum number of connections allowed by mysql. The first is the maximum number of 20 connections, the second is the maximum number of 500 concurrent connections, and the last is custom. you can select the number as needed, I chose the second-"next "?

The following is the port for database listening. the default port is 3306. if it is changed to another port, remember the modified port when connecting to the database. Otherwise, you cannot connect to the mysql database, which is troublesome, do not modify it here. use the default port of mysq: 3306-"next "?

In this step, Set the default mysql encoding. in the Character Set menu, select "gbk" encoding-"next "?
(Note: If you want to use the data of the original database, it is best to determine the encoding used by the original database. if the encoding set here is inconsistent with the encoding of the original database data, garbled characters may occur during use .)?

This step is whether to set mysql to windows. Generally, you can set it to a service so that you can enable and disable mysql databases through the service. The check boxes below are also checked. In cmd mode, you do not have to execute commands in the bin directory of mysql. That is to say, if both the upper and lower hooks are checked, the default is-"next" in the middle "?

This step is to set the mysql super user password. this super user is very important and has all permissions for mysql. please set and remember the super user password, the following check box is used to select whether to allow remote machines to connect to your mysql server as the root user. if you need this check box, check it. Here we use the default option, and enter the password in New root password and Confirm. "Next "?

Click "execute" for configuration. wait a moment and check all the dots to complete the configuration .?

2. modify the configuration:

Open D: \ WAMP \ MySQL \ my. ini?
Set datadir to D:/WAMP/MySQL/data/or the directory where you want to store the data .?

3. PHP installation?

Version description: VC9 is a script dedicated to setting values for IIS. it is compiled using the Visual Studio 2008 compiler and supports the latest Microsoft build to improve efficiency .?
VC6 is a script provided for other WEB service software, such as Apache .?
Thread Safe is ready-to-use security. star will perform Thread security checks to prevent the new Thread from consuming system resources by starting CGI execution .?
Non-Thread Safe is Non-Thread security. Does the Thread security check be performed during execution?
Select the version: PHP5.3 (5.3.1) for VC6 x86 Thread Safe ZIP download

: Http://windows.php.net/download?

1. Installation instructions?
Since we downloaded the ZIP package, we only need to extract the file to the "D: \ WAMP \ PHP" directory?

2. modify the configuration?
Change the E: \ WAMP \ PHP \ php. ini-development file to php. ini?
Open php. ini?

; Extension_dir = "ext "?
Changed to extension_dir = "E: \ WAMP \ PHP \ ext "?

Remove ";" in front of these files in the first row?
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?

; Date. timezone =?
Changed to (many websites do not mention the modification here. the default value is the U.S. time. if it is not modified, an error will be reported): date. timezone = Asia/Shanghai?

3. test

Restart Apache (after the configuration file is modified, Apache must be restarted to take effect )?
Create a new index. php page, input in the code, and save the file to the "D: \ WMAP \ www \" directory?
Open the browser and enter http: // localhost/index. php? If the display is normal, the PHP configuration is complete. can you check whether the PHP information on this page is correct .?
(Note: the input function in the file can output a large amount of information about the current PHP status, such as the PHP version, server information, and environment .)?
(Note :)?

Next, let's test whether Mysql can be connected?
Create a link. php file. enter it in the code?
$ Link = mysql_connect ("127.0.0.1", "root", "password entered during Mysql installation ");?
If (! $ Link) echo "Mysql database connection failed !";?
Else echo "Mysql database connection successful !";?
Mysql_close ();?
?>?
Also save the file to the "D: \ WMAP \ www \" directory?
Open the browser and enter http: // localhost/link. php? View?

4. PhpMyAdmin installation?

Version description: phpMyAdmin-3.2.5?
Select version: phpMyAdmin-3.2.5-all-languages.zip?
: Http://www.phpmyadmin.net/home_page/downloads.php?

1. Installation instructions?
Decompress the package to D: \ WAMP \ phpMyAdmin?

2. modify the configuration?
Open D: \ WAMP \ phpMyAdmin \ libraries \ config. default. php?

$ Cfg ['pmaabsoluteuri '] = ";?
Change to (enter the absolute URL for accessing phpMyAdmin): $ cfg ['pmaabsoluteuri '] = 'http: // localhost/PHPMyadmin /';

$ Cfg ['servers'] [$ I] ['host'] = 'localhost ';?
Change to (enter the server address, which is usually the default and does not need to be modified): $ cfg ['servers'] [$ I] ['host'] = 'localhost ';?

$ Cfg ['servers'] [$ I] ['user'] = 'root ';?
Change to (enter the Mysql user name. here we use the default value): $ cfg ['servers'] [$ I] ['user'] = 'root ';?

$ Cfg ['servers'] [$ I] ['password'] = ";?
Change to (enter the Mysql password): $ cfg ['servers'] [$ I] ['password'] = 'MySQL PWD ;?

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';?
Change to (set authentication method, security considerations, fill in as cookie): $ cfg ['servers'] [$ I] ['auth _ type'] = 'cookies ';?

$ Cfg ['blowfish _ secret'] = ";?
Change to (set the phrase password. if the cookie is set above, leave it blank. Otherwise, an error will be prompted during logon): $ cfg ['blowfish _ secret'] = 'cookies ';?

3. test?
Open the browser and enter: http: // localhost/phpmyadmin/to access and log in?

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