Win+apache+php+mysql+phpmyadmin Environment Configuration Method _ Server

Source: Internet
Author: User
Tags win32 phpmyadmin port number
Win+apache+php+mysql environment Configuration 2007-03-09 23:38 due to the students online blog from ASP to PHP, need the above environment configuration, on the Internet to find some information, but are relatively old, so decided to sum up their own.
The version I used is not up to date, but it's fairly stable, Discuz's official web site has some good instructions, and some good software downloads. Http://www.discuz.com/index.php?category=4, we can have a look.
I use the following software:
Apache:apache_2.2.3-win32-x86-no_ssl.msi,http://apache.linuxforum.net/httpd/,
Php:php-5.2.0-win32.zip, Mysql:mysql-essential-5.0.27-win32.msi, are found in Discuz's official, and are now configured.


First step: Install Apache and configure support for PHP

Click the installation file apache_2.2. 3-win32-x86-no_ssl.msi
Apache installed in the D:\apache2 directory (with their own preferences), after the installation, the Apache service automatically loaded, then open the browser, browse: http://localhost, the Apache Welcome page appears, if this step occurs, please check the installation source files, Reinstall. Of course, you can also change the port, access to add the port number on it.
Extract the contents of the Php-5.2.0-win32.zip into the D:\php.
Locate the php.ini-dist in the PHP directory and rename it to php.ini and copy it to the Windows directory.
If my php.ini is a copy to the c:\windows\system32\ directory,

Configure the httpd.conf in Apache
Open D:\Apache2\conf\httpd.conf This file
Find DocumentRoot "D:/apache2/htdocs" to change it to your Web directory (no change)
Like my "D:/htdocs" for DocumentRoot.
Find DirectoryIndex index.html Index.html.var in the back and add index.htm index.php
At the end of this configuration file, add the following statement to support the PHP program:
scriptalias/php/"c:/php/"
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. php
AddType application/x-httpd-php. phtml
Action application/x-httpd-php "/php/php.exe"
Select installation mode: Modular installation or CGI mode Setup (optional)

--------------Modular Installation Configuration------------------------------------
Find #LoadModule Ssl_module modules/mod_ssl.so this line,
After this row, add a line loadmodule php5_module D:/php/php5apache2.dll
Where D:/php/php5apache2.dll is the location of the Php5apache2.dll in your PHP directory

Find AddType application/x-gzip gz. tgz, join a line after this row
AddType application/x-httpd-php. php
---------------------------------------------------------------

--------------CGI installation configuration--------------------------------------
Find AddType application/x-gzip gz tgz This line, add the following
scriptalias/php/"d:/php/"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php/php-cgi.exe"
---------------------------------------------------------------

The PHP environment is basically configured successfully at this time
In the Web root directory (such as my d:/htdocs), build a file named test.php that reads as follows

?
Phpinfo ();
?>


Restart the Apache service
Open http://localhost/test.php with your browser,

Note: 1./\ and the difference between the original use of what is used

2. The configuration is over to restart Apache only OK

OK if you can see the PHP configuration output information



The second step is to install MySQL

MySQL installation under the Windows platform is our familiar standard installation welcome program.

If you do not need to change the default installation directory, click Next to complete the installation.

The following installation sequence explains the options in the installation process.

1, the default is typical, the proposed change to custom

This step requires the selection of components and change the folder location, components use the default, select Change to install the directory, note: Install MySQL path, can not contain Chinese!

2, the program prompts whether to register on the mysql.com, you can choose to skip, that is, skip sign-up.

3, install the end, select now start to configure the MySQL server selection box.

4, the configuration starts, chooses the first item Detailed Configuration

5, choose the type of MySQL applied, the first is the development of the server, will only use as little memory, the second is a common Web server, will use a medium amount of memory, the last one is the server only run MySQL database, will occupy all the memory, according to their own needs, choose one of them.

6, the choice of database use, the first is a multi-functional use, will be optimized to the database to a good InnoDB storage type and efficient MyISAM storage type, the second is only for transaction processing type, the best optimization innodb, but also support MyISAM, the last kind of non-transaction processing type, Suitable for simple applications, only myisam types that do not support transactions are supported. General selection of the first multi-functional, I chose the first one.

7, choose INNODDB Data storage location, the default can be.

8, choose the maximum number of connections allowed MySQL, you can choose according to their own needs, the default can

9, the choice of database listening port, the general default is 3306, if you change to other ports, later connect the database to remember the modified port, otherwise can not connect MySQL database, the default can

10, set the default code mysql, you can choose gb2312 or GBK, if you have a database file, and the original existing database encoding consistent, otherwise it may appear garbled.

11, choose whether to set MySQL into Windows services, recommended to choose a service, so that after the service can start and close the MySQL database. The following check box is also recommended, so that in cmd mode, you do not have to go to the MySQL bin directory to execute the command.

12, set MySQL superuser password, super users have all the rights to MySQL, the following check box to choose whether to allow the remote machine with root users to connect to your MySQL server, depending on the need to choose.

13, click Execute, if the previous settings are not a problem will soon be installed successfully.

After changing the default port installer, there seems to be a warning "ignore it."


Third, configure php.ini and test MySQL (php.ini under D:\Windows php.ini)

Find Extension_dir = "./" Change to Extension_dir = "D:/php/ext"
Found it
; Extension=php_mysql.dll
Will '; ' Remove Change to
Extension=php_mysql.dll
Found it
; Session.save_path = "/tmp"
Will '; ' Remove the directory where you saved the session, such as
Session.save_path = "D:/php/session_temp";

Restart the Apache service
The contents of the testdb.php file in the Web root directory (such as D:\website) are as follows:
$link =mysql_connect (' localhost ', ' root ', ' 123456 ');
if (! $link) echo "fail";
else echo "Success";
Mysql_close ();
?>
Open http://localhost/testdb.php in the browser if the output success is OK

Iv. installation and configuration of phpMyAdmin

Unzip the phpmyadmin-2.5.7.zip to the Web root directory, rename the folder to phpMyAdmin or other
Open the config.inc.php in the phpMyAdmin directory
Found it
$cfg [' Servers '] [$i] [' user '] = ' root ';
$cfg [' Servers '] [$i] [' password '] = ' 123456 ';
Fill in your MySQL user and password separately, of course, we recommend you to use Ems sqlmanager for mysql to manage your MySQL database. Software to download the site to provide
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.