The most pure Apache2 & PHP5 & Mysql5forWinXP configuration method

Source: Internet
Author: User
Tags win32 zip vbulletin
The purest configuration method of Apache2PHP5Mysql5forWinXP. Read the purest configuration method of Apache2PHP5Mysql5forWinXP. Preparation: Windows XP SP2 (in fact, the system can follow this method if it is 98 or above) in this example, I chose 2.2.2forWin.

Preparations:

Windows XP SP2 (in fact, the system can follow this method as long as it is more than 98)
Apache 2 in this example, I chose 2.2.2 for Win32 ......)

PHP 5 (although the number of versions is a bit unlucky ...... But I decided to choose 5.1.4 for Win32 Zip ......)

 
MySQL 5 (5.1 is not stable ...... Let's just select MySQL 5.0.22 for Win32 Zip ......)

This solution does not involve system folders ...... So we can select a folder in another partition to facilitate future server maintenance ...... This example uses X: \ Server ...... Note: the folder name should not contain spaces or other non-English characters ...... Otherwise, the server may crash in some situations ......

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

Run apache_2.2.2-win32-x86-no_ssl.msi ...... All the Way Down Next ...... When selecting the installation method, select the "Custom" Custom method ...... Next, select the installation path ...... Go to X: \ Server \ Apache (of course, you can select another path, or even select Complete for installation ...... I am just used to talking about how to integrate all server-related software)
I was not prepared to write the coexistence configuration of IIS and Apache ...... Think about it and bring it ...... Prompt to enter Server Information ...... At the bottom, you will be asked to select the port ...... If you have installed the IIS server ...... Select the second item "only for the current user, on Port 8080, when started manually ."...... That is to say, Apache will occupy Port 8080 ...... If you have not installed IIS ...... Ignore ......
Continue to Next ...... After several Windows services are installed in the CMD window ...... Installation is complete ...... The Apache pink feather Icon will appear in the lower right corner, and the green light should be displayed on the Icon (indicating that the HTTP servo has been started properly )...... You can try It. if "It Works" appears on the screen, the installation is successful ...... (I remember that the previous version was not like this, but a pretty fancy page ...... So as long as the page cannot be found ...... Apache servo is successfully installed.) of course ...... If a red light is on ...... Configuration error ...... Look back ......
The Apache server has been installed ......

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

Decompress the PHP-5.1.4-Win32.zip ...... And place it under X: \ Server \ PHP ......
Next, add environment variables to the PHP installation directory ...... Right-click my computer icon ...... View 'properties '...... Switch to the 'extension' tab ...... Click the 'environment variable 'button (shortcut: Alt + N )...... In the pop-up 'system variable 'field, find the 'path' variable ...... Double-click edit and add '; X: \ Server \ php' at the end of the variable value (note that there is a semicolon to separate the previous values )......
Restart your computer ...... Why? Let the environment variables take effect ......
Now PHP has been installed ...... Of course, it has not been associated with Apache ...... And no settings ...... Don't worry ...... I will write ......

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

Particularly important: If you select the latest stable PHP version 5.1.4 like me ...... The modular support PHP5apache2. dll in the officially downloaded source code package is not applicable to Apache 2.2.2 ...... We need to recompile PHP ...... However, the PHP5 lab provides the following solutions:
Download this compressed package ()...... Decompress PHP5apache2. dll into X: \ Server \ PHP to overwrite the original file ...... Throw httpd.exe. manifest to the X: \ Server \ Apache \ Bin folder ...... Finally, run vcredist_x86.exe (if you install the. Net FrameWork, you do not need to install this file )......
If you select an earlier version, skip this step.
Modify the Apache configuration file X:/Server/Apache/conf/httpd. conf.
Modify the document release path ......
Search:
DocumentRoot "X:/Server/Apache/htdocs"
Change the value to the desired release path, for example:
DocumentRoot "X:/Server/WWW"
There is another one that needs to be modified ...... Otherwise, you will not be authorized to access ......
Search:
Directory "X:/Server/Apache/htdocs"
To:
Directory "X:/Server/WWW"
Modify the default script:
Search:
DirectoryIndex index.html
Add the default script name that you want and separate it with spaces. Note that the script names are prioritized, for example:
DirectoryIndex index. PHP index.html index.htm
PHP 5 configuration:
Add the following characters at the bottom of the document:
# Call the PHP 5 module
LoadModule PHP5_module "X:/Server/PHP/PHP5apache2. dll"
# Add the Mime type ...... You can also modify the mime. types file.
AddType application/x-httpd-PHP. PHP
AddType application/x-httpd-PHP-source. phps
# Add a default character set ...... Utf8 is king ......
Adddefacharcharset UTF8
# Set the PHP. ini Directory
PHPIniDir "X:/Server/PHP"
Apache now supports PHP ...... Of course ...... This article only describes how to perform basic installation ...... Detailed configuration and optimization will not be involved ...... You can refer to the manual for configuration ......
'Www .knowsky.com
========================================================
Install MySQL:

Decompress the MySQL-noinstall-5.0.22-win32.zip ...... And place it under X: \ Server \ MySQL ......
Next, install the MySQL service ...... Open cmd.exe ...... Then go to the X: \ Server \ MySQL \ bin directory ...... (Xiami? You don't? I should write it clearly)
Start> Run> cmd> Press enter ......
Then go to the X: \ Server \ MySQL \ bin directory:
> Cd/d X: \ Server \ MySQL \ bin press enter
(If your folder contains spaces, do not forget to add double quotation marks outside the path)
Then run the MySQL service installation script:
> Mysqld-nt-install
MySQL service installed successfully is displayed, indicating that the installation is successful ......
Next, add an environment variable to the MySQL installation directory ...... Right-click my computer icon ...... View 'properties '...... Switch to the 'extension' tab ...... Click the 'environment variable 'button (shortcut: Alt + N )...... In the pop-up 'system variable 'field, find the 'path' variable ...... Double-click edit and add '; X: \ Server \ mysql' at the end of the variable value (note that there is a semicolon to separate the previous values )......
Restart your computer ...... Why? Let the environment variables take effect ......
(I rely on ...... Why not talk about it together when installing PHP ...... I have to restart it again ......)
Well ...... I forgot ......
Then configure MySQL ...... Go to X: \ Server \ MySQL ...... There should be several ini files ...... Let's take one as needed ...... The default configuration is different ...... You can also modify it yourself )...... Because I only for local development debugging, so select the my-small.ini ...... Copy it ...... Name it my. ini ...... Open it in a text editor:
Search:
[Mysqld]
Add the following lines below:
# MySQL installation directory
Basedir = X:/Server/MySQL
# Default MySQL 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 age ...... InnoDB was bought by Oracle ...... Although open-source ...... But ......
Default-storage-engine = MyISAM
Add at the bottom of the document:
[WinMySQLAdmin]
Server = X:/Server/MySQL/bin/mysqld-nt.exe
MySQL configuration completed ...... Next, let's start and try ...... Open cmd.exe ...... Input:
Net start MySQL
If 'MySQL service started successfully' is displayed '...... Indicates ...... It means this sentence is correct ...... Otherwise, check again ......
The server has started ...... We can log on and try ......
> Cd/d X: \ Server \ MySQL \ bin press enter
Log on
> MySQL-u root-p
Because there is no Password in the initial state of root, you can press Enter directly when prompted to Enter Password ......
Then, the command line enters the MySQL Shell state, indicating that the 'intrination' is successful ......
If you don't want others to intrude into you with an empty password, you 'd better set a fork password for root ......
MySQL> set password for = old_password ('password _ for_root ');
(This is a new MySQL 5 command. in earlier versions, change old_password to password)
Replace Passwor_for_root with your own password ...... Don't be too simple ......
If 'query OK 'is displayed, the modification is successful.
Believe it? You can exit; log out and try again ......
So far ...... MySQL installation is complete ...... For detailed optimization configuration, see the manual ...... As for the association between MySQL and PHP, the following will be mentioned ......

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

Go to X: \ Server \ PHP ...... Rename PHP. ini-recommend to PHP. ini and open it in a text editor ......
Modify the error report level ...... Run some nonstandard programs ...... You will find the full screen 'error '......
Search:
Error_reporting = E_ALL
To:
Error_reporting = E_ALL &~ E_NOTICE &~ E_STRICT
Because it is local debugging, of course I want the error to be output for my debugging ......
Search:
Display_errors = Off
To:
Display_errors = On
For local developers, it seems unnecessary to record errors ......
Search:
Log_errors = On
To:
Log_errors = Off
It is necessary to set the extension library path ......
Search:
Extension_dir = "./"
To:
Extension_dir = "X:/Server/PHP/ext"
By default, PHP 5 does not support MySQL ......
Search:
; Extension = PHP_MySQL.dll
Remove the semicolon:
Extension = PHP_MySQL.dll
In addition, vBulletin has already enabled support for Mysqli ...... So here we introduce the MySQL extension library ......
Search:
Extension = PHP_MySQL.dll
Add below:
Extension = PHP_mysqli.dll
Of course, to better use some image-related functions of vBulletin, we need to enable the GD2 library ......
Search:
; Extension = PHP_gd2.dll
Remove the semicolon:
Extension = PHP_gd2.dll
We also want to call some frequently-used libraries, such as PHP_mbstring.dll, PHP_curl.dll, PHP_sockets.dll, PHP_xmlrpc.dll, etc ...... Use the same method as above ......
(Only common extensions are enabled here ...... Determine other extensions as needed ......)
Although vBulletin uses its built-in Session mechanism, PHP's Session mechanism is essential in many programs ......
Search:
; Session. save_path = "/tmp"
Change to an existing path ......
Or create a tmp directory under the release directory ......
Here we use the previous method ...... First create a directory X: \ Session ......
Then modify it:
Session. save_path = "X:/Session"
Now, the settings are complete ...... PHP also supports MySQL ...... For more detailed settings, please refer to the manual ......

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

The most basic WAMP environment is configured ...... Next, I configured Zend Optimizer and Subversion ...... Because it is not standard ...... I will not introduce it here ......
In fact, the Apache server does not need to be installed ...... Unfortunately, I did not find the ZIP version 2.2.2 ...... Compiling with SRC files is too cumbersome ...... So I simply run the installer ...... Wait for the next time I reinstall the system ...... Apache becomes green ...... Let's look forward to it together ...... (About two years later ?)
Er .................. Come up with something else ......

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.