Simple installation and configuration of Apache + PhP5 + mysql4 (5) + phpMyAdmin

Source: Internet
Author: User

First, we listed apache2.050, PhP5, and mysql4.0.20 on various official websites (now 5, there are some changes, such as setting to use the wizard next method) phpmyadmin2.57 (it is best to download the latest client software, which is not the latest here)
Apache_2.0.50-win32-x86-no_ssl.msi
Php-5.0.0-Win32.zip
Mysql-4.0.20d-win.zip
PhpMyAdmin-2.5.7.zip

Windows 2000 (, XP) Operating System Disk: d

Step 1: install Apache and configure support for PHP

Click the Installation File apache_2.0.50-win32-x86-no_ssl.msi
Install Apache in the D: apache2 directory (As You Like)
Decompress the content in php-5.0.0-win32.zip to D: PHP.
Find the php. ini-Dist in the PHP Directory and rename it as PHP. ini and copy it to the Windows directory (winnt in Win2k)
For example, copy my PHP. ini file to the D: Windows directory.
Copy php5ts. dll and libmysql. dll in the PHP Directory to the system directory (System/system32). For example, if my directory is D: Windowssystem
Copy the php_mbstring.dll and php_mysql.dll files in the phpext directory to the Windows directory.

Configure httpd. conf in Apache
Open the file D: apache2confhttpd. conf.
Find the adddefadefacharset ISO-8859-1 and change it to adddefadefacharset gb2312 (to make the default language encoded as simplified Chinese)
Find DocumentRoot "D:/apache2/htdocs" and change it to your web directory (do not change it), for example, my file is DocumentRoot "D:/Website"
Find directoryindex index.html. Var and add index.htm index. php.

Select the installation mode: Modular installation or CGI installation (select the same)

-------------- Modular installation configuration ------------------------------------
Find the # loadmodule ssl_module modules/mod_ssl.so line, and add a line after this line
Loadmodule php5_module D:/PHP/php5apache2. dll
Where D:/PHP/php5apache2. dll is the location of php5apache2. dll in your PHP Directory.
Find the addtype application/X-gzip. GZ. tgz line, and add a line after this line
Addtype application/X-httpd-PHP. php
---------------------------------------------------------------

-------------- CGI installation configuration --------------------------------------
Find addtype application/X-gzip. GZ. tgz and add the following line:
ScriptAlias/PHP/"D:/PHP /"
Addtype application/X-httpd-PHP. php
Action application/X-httpd-PHP "/PHP/php-cgi.exe"
---------------------------------------------------------------

Now, the PHP environment is successfully configured.
Create a file named test. php In the web root directory (such as my D: website). The content of the file is as follows:
<? Echo phpinfo () ;?>
Restart the apache service
Open http: // localhost/test. php in a browser
If you can see the PHP configuration output information, OK

Step 2 install MySQL

Install MySql in the specified directory. For example, if my MySQL package is D:/MySQL, you can directly decompress the package to the specified directory.
Then click the file D: mysqlbinwinmysqladmin.exe, where D: MySQL is your MySQL installation directory.
Enter the initial user and password of winmysqladmin (note: this is not a user or password in MySQL ).
After confirmation, a traffic light icon will appear in the startup bar of your task in the lower right corner. The red light indicates that the service is stopped, and the green light indicates that the service is normal, left-click the icon and choose winnt> install the service to install the service.
Click the icon on the left-> winnt-> start the service to start the MySQL service.

Modify the root password of the MySQL database
Run cmd to go to the command line mode and enter the following command: (Note: D: MySQL is the MySQL installation directory)
Cd d: mysqlbin
Mysqladmin-u root-P password 123456 (where root is the user name and 123456 is the password-the same below)
Enter
Enter Password: (Note: You need to enter the original password. The password is blank at the time of installation, so press Enter)
In this case, the root password of the MySQL account is changed to 123456. installation is complete.

3. Configure PHP. ini and test MySQL (PHP. INI is D: php. ini in Windows)

Find
; Extension = php_mysql.dll
Replace ';'
Extension = php_mysql.dll
Find
; Extension = php_mbstring.dll
Replace ';'
Extension = php_mbstring.dll
Find
; Session. save_path = "/tmp"
Remove ';' from the directory where you saved the session, as shown in figure
Session. save_path = "D:/PHP/session_temp ";
Find
; Mbstring. Language = Japan
Replace ';'
Mbstring. Language = Chinese Simplified

O. K.

Restart the apache service
Create the testdb. php file in the web root directory (such as D: website) as follows:
<? PHP
$ Link = mysql_connect ('localhost', 'root', '123 ');
If (! $ Link) echo "fail ";
Else echo "success ";
Mysql_close ();
?>
Open http: // localhost/testdb. php in a browser. If success is output, it will be OK.

Iv. phpMyAdmin installation and configuration

Decompress phpmyadmin-2.5.7.zip to the web root directory, and rename the phpMyAdmin folder or other
Open config. Inc. php In the phpMyAdmin directory
Locate (change all options, otherwise the logon fails)
Change $ cfg ['pmaabsoluteuri '] to http: // localhost/phpMyAdmin
Modify $ cfg ['blowfish _ secret'] = 'admin ';
Modify $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';
Change $ cfg ['servers'] [$ I] ['user'] to a MySQL user
Change $ cfg ['servers'] [$ I] ['Password'] To the MySQL password.
Enter your MySQL user and password respectively.

If it is not used locally, it is best to add Verification

At this point, we have achieved that the GUI is certainly more comfortable than the CMD interface.

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 740838

It is recommended that you refer to the following link for installing Leng Feng Apache PhP5 MySQL phpMyAdmin:

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.