WIN2003下安装amp(apache+mysql+php+phpmyadmin)环境
2024-08-27 18:30:01
供稿:网友
一、软件准备:
apache_2.2.14-win32-x86-no_ssl.msi
php-5.2.11-Win32.zip
mysql-5.0.45-win32.exe
phpMyAdmin-3.2.3-all-languages.zip
二、安装并设置环境变量:
安装 apache_2.2.14到 c:/apache
解压PHP5.2.11到 c:/php
安装mysql-5.0.45到c:/mysql
解压phpMyAdmin-3.2.3到apache的htdoc目录
在环境变量->系统变量Path后添加 ;c:/php
三、修改配置文件:
首先是Apache的配置:
1.编辑httpd.conf 文件
查找 LoadModule 块,在后面添加:
LoadModule php5_module c:/php/php5apache2_2.dll
2.查找 DocumentRoot,将后面的第一个 <Directory></Directory>块替换为:
<Directory "c:/php">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
3.查找 ScriptAlias 块,在后面添加:
ScriptAlias /php/ "c:/php/"
4.查找 DirectoryIndex 块,修改为:
DirectoryIndex index.php default.php index.html
index.htm default.html default.htm
5.查找 AddType 块, 在后面添加:
AddType application/x-httpd-php .php
Action Application/x-httpd-php "c:/php/php.exe"
接着修改PHP配置:
6.php.ini-recommended 文件改名为 php.ini,打开php.ini文件,查找 extension_dir,修改为:extension_dir = "c:/php"
修改如下几处:
extension=/ext/php_gd2.dll
extension=/ext/php_mbstring.dll
extension=/ext/php_mcrypt.dll
extension=/ext/php_mssql.dll
extension=/ext/php_mysql.dll
extension=/ext/php_mysqli.dll
extension=/ext/php_pdo_mssql.dll
extension=/ext/php_pdo_mysql.dll
7.为phpmyadmin安装成功,修改php.ini文件,查找session.save_path成:
session.save_path = "c:/temp",去年前面的;号
8.拷贝php.ini到WINDOWS目录
9.拷贝libmysql.dll到WINDOWS/SYSTEM32目录下
四、测试php、mysql:
1.在c:/Apache/htdocs下写index.php文件(phpinfo();)
2.再修改index.php,测试mysql数据库连接
五、over