Recently, PHP is configured under XP, encountering a lot of problems during the configuration process, after getting it, summarizes the following:
1. Download the following procedure, it is free, there are apache_2.0.50-win32-x86-no_ssl.msimysql-4.0.20d-winphp-4.3.8-installer.exe in the official website.
Note: PHP has two versions of ZIP compressed and install, which strongly recommends using Install versions, otherwise Apache still can't find PHP if configured in full configuration.
2. Installation 1) Install MySQL first, then install Apache, finally install PHP, because PHP is installed with a selection server settings. After mysql installation, perform WinmysQLADMIN.EXE in the bin directory in the installation directory, will prompt to enter the super username and password, fill in, then select Install SREVICE in the lower right corner of the pallet, then the start service.
2) Apache's installation configuration process to fill in the domain name, because you can change in httpd.conf in httpd.conf, I'm filled with LocalHost. At the end of the installation, it will automatically configure the script, but if your machine is installed, the 80-port is used, it will prompt failed, but it doesn't matter, it will change the port when it is configured.
3) When the PHP is installed, select Apache as a server, and other installed paths are simple, such as D: / PHP, if you put it in a directory like Program File, it is possible to crash when you use it.
3. Configuration 1) MySQL has nothing to say, and the boot service can be used. 2) Open the CONF directory under the Apache installation path, find the httpd.conf file, open with the text editor, modify it: Put #Listen 12.34.56.78:80Listen 80
Change to #Listen 12.34.56.78:8080Listen 8080
Comment #Scriptalias / CGI-BIN / "D: / Program Files / Apache Group / Apache2 / CGI-BIN /"
Change to Scriptalias / PHP / "D: / PHP /" AddType Application / X-httpd-php .php (If you want to support more extensions, you can add multiple lines, such as addtype application / x-httpd-php .php3) Action Application / X-httpd-php "/ php/Php.exe
Note: Anti-slope
Change ServerName Localhost: 80 to ServerName Localhost: 8080
If you are using the English version, you want to support Chinese in the configuration file to find the "addLanguage" or "addcharset" line, add a line in front of these rows: AddDefaultcharset GB2312
Note: The Chinese version already has Addcharset ISO-2022-CN .ISO2022-CN .cis, so you don't have to add.
Apache After installation, the default virtual path is the HTDOCS directory in the installation directory. If you want to set other directories to the virtual path, refer to the last appendix.
3) Copy PHP4Ts.dll in the PHP installation directory to the System32 directory, such as copy to C: / Windows / System32; then copy the pHP.ini under the Backup directory to the Windows directory, open it with the text editor Find content in the [MySQL] field. Modify it.
MySQL.DEFAULT_PORT = 3306 / / Here is the port of MySQL.
MySQL.DEFAULT_HOST = localhost // This is a local host.
mysql.default_user = root / / This is a super user
mysql.default_password = 123456 / / This is a super user password
Modify it here to let PHP associate with MySQL.
Finally, the PHP is started to support the MySQL module.
Find; extension = php_mysql.dll string. Delete the front; number, become extension = php_mysql.dll
Then find the doc_root field, fill in the virtual path of Apache DOC_ROOT = D: / Program Files / Apache Group / Apache2 / HTDOCS
4. Run
Restart Apache, put a PHP file in the HTDOCS directory, such as A.php
Then enter http: // localhost: 8080 / a.php in IE.
5. Appendix: How to change the default virtual path.
First we have to add a directory in C: / web / down, such as WWW, then change it as follows in httpd.conf:
--------- Before the change -------------
DocumentRoot "C: / Web / Apache / HTDOCS" original path
## Each directory to which Apache has access, can be configured with respect # to which services and features are allowed and / or disabled in that # directory (and its subdirectories). ## First, we configure the "default" to be a Very Restrictive Set of # permissions. #
## Note that from this point forward you must specifically allow # particular features to be enabled -. So if something's not working as # you might expect, make sure that you have specifically enabled it # below #
## this kind be changing to whatver you set documentroot to. #
## This May Also Be "None", "All", or any combination of "indexes", # "includes", "followsymlinks", "fulcci", or "multiviews". ## Note That "MultiViews" Must Be named * explicitly * --- "Options All" # does not give it to you. # Options Indexes FollowSymLinks MultiViews ## This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination Of "options", "fileinfo", # "authconfig", and "limited" #allowoverride none
## Controls Who can Get Stuff from this server. # Order allow, denyallow from all directory>
---------- After the change -------------
DocumentRoot "C: / Web / WWW"
## Each directory to which Apache has access, can be configured with respect # to which services and features are allowed and / or disabled in that # directory (and its subdirectories). ## First, we configure the "default" to be a Very restrictive set of # permissions. #
## Note that from this point forward you must specifically allow # particular features to be enabled -. So if something's not working as # you might expect, make sure that you have specifically enabled it # below #
## this kind be changing to whatver you set documentroot to. #
## This May Also Be "None", "All", or any combination of "indexes", # "includes", "followsymlinks", "fulcci", or "multiviews". ## Note That "MultiViews" Must Be named * Explicitly * --- "Options all" # doesn't give it to you. # Options all ## This Controls Which Options The .htaccess Files in Directories CAN # Override. can also be "all", or any combination of " Options "," fileInfo ", #" authconfig ", and" limited "#allowoverride all
## Controls Who can Get Stuff from this server. # Order allow, denyallow from all directory>
## UserDir:. The name of the directory which is appended onto a user's home # directory if a ~ user request is received ## Under Win32, we do not currently try to determine the home directory of # a Windows login, so a format Such as this below needed. See # The userdir documentation for details. #
6. Appendix: How to set the default boot page
Also in httpd.conf
Find the following fields and add your own file name, pay attention: add a space between each file name