1. Install the Apache package and decompress PHP directly.
2. Add the c: \ PHP path to the system variable path.
4. Go to the PHP installation directory in the resource manager and copy PHP. ini-Dist or PHP. ini-recommended and name it PHP. ini. Then open PHP. ini.
|
; Extension = php_mysql.dll
Remove the previous; number and change it:
Extension = php_mysql.dll
Find:
Extension_dir = "./"
Change it to the absolute path of the ext subdirectory in your PHP installation directory. For example, my:
Extension_dir = "D: \ PHP \ ext \"
This step is important. Otherwise, PHP cannot find the php_mysql.dll module and cannot load it. |
5. Modify HTTP. conf
DocumentRoot "C:/PHP/mywork"
....
<Directory "C:/PHP/mywork">
....
# The following content is newly added
Loadmodule php5_module "C:/PHP/php5apache2_2.dll"
Phpinidir "C:/PHP"
Change directoryindex index.html
Directoryindex index. php index.html
# Addtype application/X-gzip. GZ. tgz
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. html |
6. Test PHP
<?Phpphpinfo ();?>