How to configure the PHP Web site Runtime environment on Windows 7

Source: Internet
Author: User
Tags benchmark
How to configure the PHP site runtime environment under Windows 7

?

One, Apache installation?

Version explanation: OpenSSL is a representation with the OpenSSL module, using OpenSSL to configure SSL secure links to Apache, that is, access using https://.
Nossl means no OpenSSL module and cannot be used for SSL secure links, where we download with OpenSSL.

Select version: Apache_2.2.14-win32-x86-openssl-0.9.8k.msi (This is a 32-bit example)
Download Address: http://www.apache.org/dist/httpd/binaries/win32/

First we create a new directory in the D drive (the drive letter is chosen according to the actual situation), and some of the content that is named "WAMP" after it is "Wdindows Apache Mysql PhpMyAdmin" will be installed in that directory.

1. Installation Instructions:

Run the Apache installer, the method is very simple, after the installation interface has been "next"



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

There are 2 options, the default is 80 port, the second is 8080 port, according to the individual needs of choice, usually the default 80 port.
We continue to install, choose Custom (Customized installation)-"Next"



Where there is a red X component, we click this component to select "This feature, and all subfeatures, will is installed on the local hard drive.", that is, "in this section, and in the subordinate sub-section Installed on the local hard drive. -"Next"?

Then select "Change" in the lower right corner to alter the installation path and install to the directory you just created "D:\WAMP\Apache\"-"Next"?
After installation, the lower right corner of the computer will be an extra icon, double-click to open, select Start or restart, can run normally, this installation is complete.

2. Modify the configuration:

Open the installation record D:\WAMP\Apache\conf\httpd.conf file (when you modify 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 changes)?

Ctrl+f Find what you want to modify after opening it?

under #loadmodule vhost_alias_module modules/mod_vhost_alias.so add:?
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 (where the path is the same as the Wwwroot directory in IIS, for storing web pages, customizing or not modifying the default): DocumentRoot "D:/wamp/www"?

modified to (custom or not modified by default):?

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

3. Test

Create a index.html page in the d:/wamp/www directory?
Enter http://localhost/in the browser? If the
is displayed correctly, the Apache configuration is complete, and it is running normally.

Second, MySQL installation?      

Version explained: The Essentials package: does not contain embedded server and benchmark suite, has the automatic installer and the configuration Wizard, does not have the MySQL documentation.?
The complete package: Includes embedded server and benchmark suite with automatic installer and Configuration Wizard with MySQL documentation.?
The Noinstall Archive: contains embedded server and benchmark suite, there is no automatic installer and Configuration Wizard, there is 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:\WAMP\Mysql"-"Next"?

Click "Finish" after installation?
Then a configuration Wizard-"Next" appears?

Select detailed configuration (verbose)-"next"?

There are 3 options:

Developer machine, will only use as little memory;?
Server machine, the medium amount of memory will be used;?
Dedicated MySQL server machine, this server only runs MySQL database, will occupy all the memory.
Can choose according to their own needs, here we choose the second type of "Server machine"-"next"?

There are also 3 options for selecting a database purpose:

Mutltifunctional database Multi-purpose, will be optimized to a good InnoDB storage type and efficient MyISAM storage type;
Transactional Database Only is used for transaction type, the best optimization innodb, but also supports MyISAM;
Non-transactional databse only non-transactional type, suitable for simple applications, only myisam types that do not support transactions are supported.
Generally choose the first multifunctional, also we are. -"Next"?

Choose INNODDB data storage location, generally default on the line, in order to unify I filled out "wamp/mysql datafiles"-"next"?

Choose the maximum number of connections allowed by MySQL, the first is the maximum number of 20 connection concurrency, the second is the maximum number of 500 concurrent connections, the last one is custom, I can choose according to demand, I choose the second-"next"?

The following is the selection of the database listening port, the general default is 3306, if you change to another port, the subsequent connection to the database to remember the modified port, or you can not connect to the MySQL database, more trouble, here do not modify, with mysq default port: 3306-"Next"?

This step sets MySQL's default encoding, we select the third one, and in the Character set menu, select "GBK" Encoding-"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 whether to set up MySQL as Windows, the general choice to set up a service, so that you can later start and close the MySQL database through the service. The following check boxes are also checked, so that in cmd mode, you do not have to execute commands in the bin directory of MySQL. That is, the upper and lower 2 tick all hit, the middle Default-"next"?

This step is to set up the MySQL super user password, this super user is very important, for MySQL has full permissions, please set up and remember the superuser password, below is a check box is to choose whether to allow the remote machine root user to connect to your MySQL server above, if there is this need, Please also tick. Here we use the default selection and enter the password in new root password and confirm. "Next"?

Click "Execute" to configure, a little wait for a while, the dots on all the tick, the configuration is complete.

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

Third, PHP installation?

Version Explanation: VC9 script specifically for IIS, compiled with the visual Studio 2008 compiler, supports the latest Microsoft build, thus improving efficiency.
VC6 is for other Web services software to provide scripts such as Apache.
Thread safe is off-the-shelf security, and the star will be threaded security checks to prevent the intention of requiring a new thread to start the CGI execution mode and drain system resources.
Non thread safe is non-thread safe and does not thread (thread) security check at execution time?
Select version: PHP5.3 (5.3.1) VC6 x86 Thread safe under zip download

Download address: http://windows.php.net/download/?

1. Installation instructions?
Since we are downloading a zip archive, just unzip the file into the "D:\WAMP\PHP" directory.

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

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

will be 947 lines down, these files in front of ";" 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 to (many sites do not mention here to modify, the default is the United States time, if not modified will error): Date.timezone = Asia/shanghai?

3. Testing

Restart Apache (the modified configuration file must be restarted for Apache to take effect)?
Create a new index.php page, enter it in the code, and save the file in the "D:\WMAP\www\" directory?
Open Browser input: http://localhost/index.php? If you can display correctly, the PHP configuration is complete, you can view the PHP information on this page 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:)?

Next we test, can you connect to MySQL?
Create a new link.php and enter it in the code below?
$link =mysql_connect ("127.0.0.1″," "Root", "password entered when MySQL is installed");
if (! $link) echo "MySQL database connection failed!";?
else echo "MySQL database connection succeeded!";?
Mysql_close ();?
>?
Also save the file in the "D:\WMAP\www\" directory?
Open Browser input: http://localhost/link.php? view?

Four, phpMyAdmin installation?

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?
Unzip to D:\WAMP\phpMyAdmin?

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

$cfg [' pmaabsoluteuri '] = ";?
Modified to (fill in the absolute URL to 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 MySQL password): $cfg [' Servers '] [$i] [' password '] = ' mysql PWD;

$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';?
Modified to (Set authentication method, security factor consideration, fill in cookie): $cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';

$cfg [' blowfish_secret '] = ";?
Modified to (set the phrase password, if the above is set to a cookie, then this can not be left blank, or login will prompt error): $cfg [' blowfish_secret '] = ' cookie ';

3. Test?
Open Browser input: http://localhost/phpmyadmin/access and login?

This article transferred from: http://www.win7china.com/html/13026.html

?

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