windows下设置php+apache+mysql

Install apache_1.3.34-win32-x86-no_src
When installing it, choose CUSTOM, change the path to C:/
This will install it to C:/Apache

Open php-4.4.1-Win32.zip in WinZip
Extract this to C:/
After extracting it, rename the directory C:/php-4.4.1-Win32 to C:/php

Extract mysql-4.0.17-win.zip to a temp folder
Run Setup.exe
This will install mySQL to C:/mysql


PHP
---
move all files from c:/php/dlls to c:/php
move all files from c:/php/sapi to c:/php
copy php-ini-recomended to c:/WINNT/php.ini

edit C:/WINNT/php.ini file:

Around line 569:
uncomment ;extension=php_gd2.dll

Around line 436:
edit doc_root =
for example, doc_root = c:/Apache/htdocs

Around line 443:
edit extension_dir =
for example extension_dir = "c:/php/extensions"

Around line 285:
edit error_reporting  =
change to  E_ALL | E_PARSE


mySQL
-----

Copy the configuration file:
copy c:/mysql/my-small.cnf to c:/WINNT/my.cnf

Install the service:
cd c:/mysql/bin
mysqld --install

net start mysql

do a test if the client works:

mysql (this should start the client)

exit the client:

set the root password:

mysqladmin -u root password NEWPASSWORD


Apache
------

edit /apache/conf/httpd.conf

Add this to the LOADMODULE section, around line 193
LoadModule php4_module "C:/php/php4apache.dll"

Add this to the ADDMODULE section, around line 241
AddModule mod_php4.c

Change this around line 386
<IfModule mod_dir.c>
    DirectoryIndex index.html
</IfModule>
to this
<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>

Find this around line 728
    AddType application/x-tar .tgz
   
Add this under it:
    AddType application/x-httpd-php .php
   
Save this file

net stop apache
net start apache  (there should be no errors)

Test Apache
-----------

make a new file, phpinfo.php, and save it in your htdocs directory

<?php
phpinfo();
?>

Access this file with your web browser:

Did it work?


Setup phpMyAdmin
----------------

Using WinZip, extract the phpMyAdmin file to c:/apache/htdocs

It will make a folder there, phpMyAdminXXXXXX - rename this folder to pma

edit config.default.php

around like 73, put in your root password, and save the file

access phpmyadmin here:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/8699.html