Recently, PHP has been configured under XP. After the configuration process, many problems are encountered, after getting it, summarize as follows: 1. Download the following procedure, all free, Apache_2.0.50-Win32-x86-no_ssl.msimysql -4.0.20d-winphp-4.3.8-installer.exe Note: PHP has two versions of ZIP compressed and install, which is strongly recommended to use Install versions, otherwise Apache still can't find PHP when configuring is completely correct. . 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 confed directory under the Apache installation path, find the httpd.conf file, open with the text editor, modify the following: Change #Listen 12.34.56.78:80Listen 80 to #Listen 12.34.56.78:8080Listen 8080 Put #Scriptalias / CGI -bin / "d: / program files / apache group / apache2 / cgi-bin /" Note Removal to Scriptalias / PHP / "D: / PHP /" AddType Application / X-httpd-php .php (if you want to support more Multi-extension, you can add multi-line, such as addtype application / x-httpd-php .php3) action application / x-httpd-php "/ php/Php.exe Note: Remove Servername localhost: 80 to ServerName Localhost: 8080 If you use the English version, you want to support Chinese in the configuration file to find the "addlanguage" or "addcharset" in the configuration file, add a line in front of these rows: adddefaultcharset GB2312 Note: Chinese version already has Addcharset ISO -2022-cn .iso2022-cn .cis, so it is not added. Apache is installed after installation, the default virtual path is the HTDOCS directory in the installation directory. If you want to set other directories to a 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 the local host. MySQL.DEFAULT_USER = root // This is superuser mysql .default_pansword = 123456 // This is a super user password to modify it here to associate with MySQL. Finally launch PHP to MySQL module support. Find; extension = php_mysql.dll string. Delete the front; 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 / next, such as WWW, then change as follows in httpd.conf: --------- Change before- --------- - 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. #
----------- 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. #