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
<? Php echo date ("Y-m-d H: I: s");?> 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:
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
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.
<? Php
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
<? Php
$ 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.