Install and configure the php development environment in Windows 7

Source: Internet
Author: User
Tags php development environment

How to configure PHP and Apache to run together:

The first thing to note is to download the PHP installation package. The address is composer.

Then you can install it in the following ways:

1. Apache installation version Description: OpenSSL indicates that the OpenSSL module is included. With OpenSSL, you can configure an SSL Secure 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

 

1. install Apache

"This explanation: 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

: Http://www.apache.org/dist/httpd/binaries/win32/

First, create a directory on drive D (which is selected based on the actual situation,

And named "Wamp", which means that some content installed after "wdindows Apache MySQL phpMyAdmin" will also be installed in this directory.

1. Installation instructions:

Run the Apache installation program. 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"

Select "change" in the lower-right corner to change the installation path and install it in the directory just created. "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. 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)

Press Ctrl + F 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 is displayed properly, Apache is configured and running properly.

Ii. Install MySQL

"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. We will not change it-"Next"

Path: "D: \ Wamp \ mysql"-"Next"

"After installation, click" finish"

A Configuration Wizard-"Next" appears"

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, which only runs the MySQL database and occupies all the memory.

You can choose one based on your needs. 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 efficient MyISAM storage type;

Transactional database is only used for transaction processing. It is best to optimize InnoDB, but 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, select 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. We select the third 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, the upper and lower sides are checked, and the middle default is-"Next"

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.

Iii. PHP installation

"This explanation: 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 system from consuming system resources by starting the CGI execution method of the new thread as required.

Non-thread safe is non-thread-safe. No thread security check is 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 configuration

Change the E: \ Wamp \ PHP. ini-development file to PhP. ini.

Open PHP. ini

; Extension_dir = "Ext"

Changed to extension_dir = "E: \ Wamp \ PHP \ Ext"

Remove the ";" 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 =

Modified to (many websites do not mention the modification here. The default value is us 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, it takes effect only after Apache is restarted)

Create an index. php page, enter it in the code, and save the file to the "D: \ WMAP \ www \" directory.

Open the browser and enter http: // localhost/index. php. If it is displayed properly, it indicates that PHP is configured and you can 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, we will test whether MySQL can be connected.

Create a link. php file and 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 ();

?>

Save the file to the "D: \ WMAP \ www \" directory.

Open the browser and enter http: // localhost/link. php to view

4. phpMyAdmin Installation

"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 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 (fill in the MySQL user name, here we default): $ 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, and 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 on

V. End

So far, the PHP environment in Windows 7 has been set up.

 

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.