The purest apache2/php5/mysql5 for WinXP configuration method

Source: Internet
Author: User
Tags character set command line install php iis ini mysql win32 win32 zip

Pre-Preparation:

Windows XP SP2 (in fact, as long as the system is more than 98 can follow this method I think)
Apache 2 In this example I chose 2.2.2 for Win32 ... )
http://archive.apache.org/dist/httpd/

PHP 5 (although the version number is a bit unlucky ...) But I decided to choose the 5.1.4 for Win32 Zip version ... )
http://www.php.net/downloads.php

MySQL 5 (5.1 is not yet stable ...) Let's just choose the MySQL 5.0.22 for Win32 Zip version ... )
http://www.mysql.com/

This program does not involve system folders ... So we can choose a folder of other partitions to facilitate future server maintenance ... This is to take X:\Server as an example ... Note: The folder name is best not to include spaces or other non-English characters ... Otherwise, it is easy to cause server crashes ...

========================================
Install Apache:

Run Apache_2.2.2-win32-x86-no_ssl.msi ... All the way Next down ... To choose the way to install, choose "Custom" customization ... Then next select the installation path ... Navigate to X:\Server\Apache (of course, you can choose another path, or even choose Complete installation is OK ...) I'm just used to talking about all server-related software being lumped together.
It was not intended to write the coexistence configuration of IIS and Apache ... Think about it or bring a pen ... When prompted to fill out the Server information ... The bottom will allow you to select the port ... If you install the IIS server ... Here's the second item "Just for the", "the", "Port 8080, when started manually." ...... That means Apache will occupy 8080 ports ... If you don't have IIS installed ... Ignore the ...
Continue Next ... Pop up several CMD windows after installing Windows service ... The installation is complete ... The lower right corner will appear the Apache pink feather icon, does not appear unexpectedly the icon should display the green light (indicates that the HTTP servo has already started normally) ... You can visit http://www.quchao.com/to try, if the screen appears "it works" means the installation is successful ... (I remember the previous version is not like this, but a very fancy page ...) So as long as there is no hint that the page cannot be found ... The Apache servo was installed successfully) of course ... If you light up a red light ... Configuration Affirmation Error ... Look back and check it out.
The Apache server is installed ...

=======================================
Install PHP:

Decompression Php-5.1.4-win32.zip ... and placed under the X:\Server\PHP ...
Next, add the environment variables to the PHP installation directory ... Click on the right mouse button on my Computer icon ... View ' Properties ' ... Then switch to the ' Advanced ' tab ... Click on the ' Environment variable ' button (shortcut: alt+n) ... Find the ' Path ' variable in the ' System variables ' field that pops up ... Double-click Edit and add at the end of the variable value '; X:\Server\PHP ' (Note that there is a semicolon to separate the previous value) ...
Reboot the computer ... Why? Let the environment variable take effect Bai ...
PHP has been installed so far ... Of course, it's not yet associated with Apache ... And no setting ... Don't worry ... Later I will write ...

=======================================
Configure Apache:

A particularly important step: if you're like me, choose the current version of the latest PHP stable 5.1.4 ... The official downloaded source package in the modular support PHP5apache2.dll is not suitable for Apache 2.2.2 ... It's been found that PHP needs to be recompiled ... But the PHP5 Lab offers solutions:
Download this compression pack (Http://www.phpv.net/php5apache2.dll-php5.1.x.rar) ... After decompression, throw the PHP5apache2.dll into the X:\Server\PHP to overwrite the original file ... Throw httpd.exe.manifest into the X:\Server\Apache\Bin folder ... Finally run Vcredist_x86.exe (you do not need to install this file if you have the. Net FrameWork installed) ...
Of course, you can skip this step if you choose to compare older versions.
The following starts modifying the Apache configuration file: x:/server/apache/conf/httpd.conf
Modify Document Publishing Path ...
Search:
DocumentRoot "X:/server/apache/htdocs"
Change the value to the publication path you want, such as:
DocumentRoot "X:/server/www"
Then there's one more place to change ... Otherwise, you will not be authorized to access ...
Search:
Directory "X:/server/apache/htdocs"
Modified to:
Directory "X:/server/www"
To modify the default script:
Search:
DirectoryIndex index.html
Add the default script name you want, separated by a space, and pay attention to precedence, such as:
DirectoryIndex index. PHP index.html index.htm
Configuration for PHP 5:
Add the following characters to the bottom of the document:
# Call PHP 5 module
LoadModule php5_module "X:/server/php/php5apache2.dll"
# Add Mime Type ... You can also modify the Mime.types file
AddType application/x-httpd-php. Php
AddType Application/x-httpd-php-source. Phps
# add default character Set ... utf8 is the king ...
Adddefaultcharset UTF8
# Set up php.ini directory
Phpinidir "x:/server/php"
So far, Apache has been able to support PHP ... Of course...... This article only describes how to do a basic installation ... Will not involve detailed configuration and optimization ... You can refer to the manual for your own configuration ...
' Www.knowsky.com
=======================================
Install MySQL:

Decompression Mysql-noinstall-5.0.22-win32.zip ... and placed under the X:\Server\MySQL ...
Next, install the MySQL service ... Open cmd.exe ... Then enter the X:\Server\MySQL\bin directory ... Shrimp You don't? Well, I'll just write it out.
Start-> run->cmd-> carriage return ...
Then enter the X:\Server\MySQL\bin directory:
>CD/D X:\Server\MySQL\bin Carriage return
(If your folder has spaces, don't forget to add double quotes outside the path)
Then run the MySQL Service installation script:
>mysqld-nt-install
Displays the MySQL service installed successfully, indicating that the installation was successful ...
Next, add an environment variable for the MySQL installation directory ... Click on the right mouse button on my Computer icon ... View ' Properties ' ... Then switch to the ' Advanced ' tab ... Click on the ' Environment variable ' button (shortcut: alt+n) ... Find the ' Path ' variable in the ' System variables ' field that pops up ... Double-click Edit and add at the end of the variable value '; X:\Server\MySQL ' (Note that there is a semicolon to separate the previous value) ...
Reboot the computer ... Why? or let the environment variable take effect ...
(I am ...) When installing PHP, why not say it together ... I'm going to have to reboot again ... )
Well, what about this? I forgot......
Then configure MySQL ... Come to X:\Server\MySQL ... There should be a number of INI files inside ... We have to take one of our own (the same ... Only the default configuration is different ... You can also modify it yourself) ... Because I only for local development debugging, so chose the My-small.ini ... Copy it to ... Named My.ini ... Open it with a text editor:
Search:
[Mysqld]
Add the following characters below rows:
#MySQL installation directory
Basedir=x:/server/mysql
#MySQL Default Data Directory
Datadir=x:/server/mysql/data
# Default Character Set ... Set it to UTF8.
Default-character-set=utf8
# Default Storage Engine ... Let's go back to the MyISAM era. InnoDB was bought by Oracle ... Although open source ... But......
Default-storage-engine=myisam
Then add at the bottom of the document:
[Winmysqladmin]
Server=x:/server/mysql/bin/mysqld-nt.exe
MySQL Configuration Complete ... The following can be started to try ... Open cmd.exe ... Input:
net start MySQL
If the ' MySQL service has started successfully ' ... It means ... It means that the words are correct ... Otherwise, please check back.
The server started ... We can log in and try ...
>CD/D X:\Server\MySQL\bin Carriage return
Then log in.
>mysql-u root-p
Because the root initial state no password, prompt enter Password direct return can ...
Then the command line enters the MySQL Shell state, which means ' invasion ' success ...
If you don't want someone else to invade you with an empty password, it's best to set a pin for root.
Mysql>set password for ' root ' @ ' localhost ' = old_password (' password_for_root ');
(This is the new MySQL 5 command, the previous version please change the old_password to password)
Replace the passwor_for_root with your own password ... Don't be too easy ...
Prompt ' Query Ok ' indicates that the modification was successful.
Don't believe it? You can exit; Go out and login and try again ...
So far...... MySQL installation work finished ... Please refer to the manual for detailed optimization configuration ... As for MySQL's association with PHP, the following will refer to ...

=====================================
' Www.knowsky.com
Configure PHP:

Enter X:\Server\PHP ... Rename Php.ini-recommend to php.ini and open with a text editor ...
Modify Error Reporting level ... Run some programs that are not standard written ... You will find the full screen of the ' error ' ...
Search:
error_reporting = E_all
Modified to:
error_reporting = error_reporting = E_all & ~e_notice & ~e_strict
Because it is local debugging, I certainly hope that the error is output for my debugging ...
Search:
Display_errors = Off
Modified to:
Display_errors = On
For local developers, there seems to be no need to log errors ...
Search:
Log_errors = On
Modified to:
Log_errors = Off
It is necessary to set the path of the extension library ...
Search:
Extension_dir = "./"
Modified to:
Extension_dir = "X:/server/php/ext"
PHP 5 By default is not open to the support of MySQL ...
Search:
; Extension=php_mysql.dll
Remove the preceding semicolon:
Extension=php_mysql.dll
In addition, VBulletin has already enabled the support of mysqli ... So here we introduce the MySQL extension library ...
Search:
Extension=php_mysql.dll
Add below:
Extension=php_mysqli.dll
Of course, in order to better use some of VBulletin's image-related features, we need to enable the GD2 library ...
Search:
; Extension=php_gd2.dll
Remove the preceding semicolon:
Extension=php_gd2.dll
We also want to make calls to some of the more commonly used libraries, such as Php_mbstring.dll, Php_curl.dll, Php_sockets.dll, Php_xmlrpc.dll, etc. ... Open Method Ditto ...
(only the common extensions are enabled ...) Other extensions please decide on your own needs ... )
Although VBulletin uses its built-in session mechanism, PHP's session mechanism is essential in many programs ...
Search:
; Session.save_path = "/tmp"
Modified to a path of existence ...
or create a TMP directory under the publishing directory ...
Here we choose the former method ... First create such a directory X:\Session ...
Then modify to:
Session.save_path = "X:/session"
Basically set up here to complete ... PHP can also support MySQL properly ... More detailed settings, we still go to the manual ...

====================================
Conclusion:

The most basic WAMP environment is completely configured ... Next I also configured Zend Optimizer and Subversion ... Because it is not standard ... Here is not to do the introduction ...
In fact, the Apache server can also not install ... Unfortunately I did not find the ZIP version of 2.2.2 ... and the SRC file for compiling is too cumbersome ... So simply execute the installer ... When I reload the system next time ... The Apache becomes green ... Let's look forward to ... (About two years later?) )
Uh.................. Think of anything to add in ...



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.