How to configure the php environment in Windows XP _ PHP Tutorial

Source: Internet
Author: User
Tags docs download
How to configure the php environment in Windows XP. Download PHP5: Docs download apache: down. chinaz. comsoft18000.h download PHP5: php Tutorial. net/distributions/php-5.2.6-Win32.zip "target =" _ blank "> http://cn2.php.net/distributions/php-5.2.6-Win32.zip
Download apache: http://down.chinaz.com/soft/18000.htm


I. install and Debug php
Because php is a zip file (not an install version), it is easy to install. just decompress it. Rename the decompressed php5.2.1-Win32 to php5. And copy it to the C directory. The installation path is c: php5.
1. find the php. ini-dist or php. ini. recommended file in the php directory and rename it php. ini.
And copy it to the windows directory of the system disk (take c: windows as an example ).
2. copy php5ts. dll and libmysql tutorial. dll under the php directory to the c: windowssystem32 directory.
3. copy the php_gd2.dll, php_mysql.dll, and php_mbstring.dll files in the php5ext directory to the c: windowssystem32 directory.
If php_gd2.dll php is not loaded, the image cannot be processed. Mysql function libraries are not supported when php_mysql.dll php is not loaded.
Php_mbstring.dll supports wide characters when phpmyadmin is followed.
4 Open the c: windowsphp. ini file (associated with mysql)
Set Extension path
Find the line extension_dir with extension_dir = "./"
Change this row
Extension_dir = "C: php5ext"
C: php5 is the path for installing php. Dll cannot be loaded if the path is incorrect.
(Note: Some php versions are; extension_dir = "./" remove the semicolon from the previous version)
Search for extension
Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dl
Remove the semicolon before the preceding three items so that these dll files can be loaded at apache startup.
Of course, we copied these dll files to system32
Php5 time difference
Time difference: eight hours
Why? The time zone settings are added for the PHP5 series. the default value is Greenwich Mean Time, which is 8 hours different from the East 8 zone in China.
Find the row in date. timezone
; Date. timezone =
Replace;
Date. timezone = PRC
II. apache debugging and integration
1. modify the website root directory
Find that DocumentRoot has such a line
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
This is the root directory of your website. you can modify it or use the default one. if you change it, you must modify the following one. Otherwise, the 403 error may occur.
Find This shoshould be changed to whatever you set DocumentRoot
There are two rows below it:

Change the C:/Program Files/Apache Group/Apache2/htdocs of the preceding two items to the directory you want.
2. make apache support *. php (webpage)
Find DirectoryIndex index.html. var
Modify
DirectoryIndex index.html. var index. php
In this way, index. php can act as the default page.
3. modular installation of php in Apache
Find # LoadModule foo_module modules/mod_foo.so
Add a line after this line
LoadModule php5_module C:/php5/php5apache2. dll // Note: C:/php5/php5apache2. dll is the path for installing php. do not set php5apache2. dll and php5apache. dll obfuscation. php5apache. dll is only applicable to apache version 1. php5apache2 in the PHP5 compressed package. dll is only applicable to apache2.0. *, if it is 2. 2. * In the above version, "Cannot load C:/php/php5apache2. dll into server: The specified module cocould not be found. "Or:" The requested operation has failed"
4. find AddType application/x-gzip. gz. tgz
Add a line after this line
AddType application/x-httpd-php. php (remember: there is a space in the front !!!)
In this way, apache can explain the php file.
5. test
Create a phpinfo. php file under the root directory of the website.

Phpinfo ();
?>

Open in a browser
Http: // localhost/phpinfo. php
5. test the association between php and mysql database tutorials.
Create a test. php file under the root directory of the website

$ Link = mysql_connect ("localhost", "root", "12345"); // change 12345 to your mysql password.
If (! $ Link) echo "failed! ";
Else echo "successful! ";
Mysql_close ();
?>

Open http: // localhost/test. php in the browser
If the output is successful, it means it is done.

Composer php Tutorial. net/distributions/php-5.2.6-Win32.zip "target =" _ blank "> http://cn2.php.net/distributions/php-5.2.6-Win32.zip download apache: http://down.chinaz.com/soft/18000.h...

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.