xp最新安装apache+php+mysql+myadmin_WinXP + Apache +PHP5 + MySQL + phpMyAdmin安装全功略

本文详细介绍了如何在Windows XP系统上安装和配置Apache、PHP5和MySQL,包括下载必要的组件、修改配置文件以及进行测试。在安装过程中提到了phpMyAdmin的配置,并给出了安装过程中可能遇到的问题和解决方法,如PHP模块的加载、MySQL的用户和密码设置等。
摘要由CSDN通过智能技术生成

WinXP + Apache +PHP5 + MySQL + phpMyAdmin安装全功略

更新时间:2006年07月09日 00:00:00   作者:

I finally got this to work, so I will post my findings here.

//PHP 5 : Windows build needs a MySQL DLL

//PHP 5.0 doesn't come with mysql support... You have to get the librariesyourself...

//I think u can get them from mysql.com

// PHP 5 Beta 2

//The file php_mysql.dll comes with these snapshots, as well as a new version of libmySQL.dll,

//so I suggest a full upgrade to Beta 2 instead of just extracting php_mysql.dll for use with Beta 1.

--------------------------------------------------------

到 www.jetdown.com 下载下面三种软件,做好安装准备

apache_2.0.47-win32-x86-no_ssl.msi

mysql-4.0.14-win.zip

phpMyAdmin-2.5.3-rc1-php.zip

----------------------------------------------------------------------------------------------

PHP 5 Beta 2 http://snaps.php.net/win32/php5-win32-latest.zip size:5.87 MB (6,162,835 bytes)

----------------------------------------------------------------------------------------------

<1>安装配置PHP

1.解压缩PHP压缩包到C:\php\

2.复制C:\php\目录下的php4ts.dll及C:\php\dlls目录下的所有文件到windows安装目录的系统文件夹里

(win9x/me是system目录,winNT,2k/winXP,2003是system32目录)

复制C:\php\php.ini-dist到windows安装目录下(如:c:\windows),并将其改名为php.ini。用记事本打开,修改一下信息:

搜索extension_dir = ./ 这行,并将其路径指到你的PHP目录下的extensions目录,比如:

extension_dir = C:\php\extensions

如若想支持更多模块,,搜索:

;Windows Extensions

;Note that MySQL and ODBC support is now built in, so no dll is needed for it.

下面都用分号在前面注释掉了支持的扩展模块,如果你想PHP支持某个模块,请将前面的“;”去掉即可

修改完成后,保存php.ini,到此完成PHP的安装和配置。

我们在下面加入一行

extension=php_mysql.dll

//Note 1: The extension dir need not be ".\", as Hermawan mentioned. It works fine for me with the extensions subdir where the other extensions are located.

//Note 2: The php.ini file need not be in the Apache root, as lars mentioned. It works fine for me in the Windows dir.

<2>安装Apach2

1.备份 C:\Program Files\Apache Group\Apache2\conf\httpd.conf 文件。

2.用记事本打开C:\Program Files\Apache Group\Apache2\conf\httpd.conf

找到:

#NameVirtualHost *

修改为:

NameVirtualHost 127.0.0.1 //或localhost

找到:

修改下面几行:

ServerAdmin (你刚才安装时候输入的管理员信箱)

DocumentRoot C:\Program Files\Apache Group\Apache2\htdocs

ServerName Apache2

ErrorLog C:\Program Files\Apache Group\Apache2\logs\error_log

CustomLog C:\Program Files\Apache Group\Apache2\logs\access_log common

找到:

AddType application/x-tar .tgz

在下面添加以下两行:

AddType application/x-httpd-php .php

AddType image/x-icon .ico

找到:

#LoadModule ssl_module modules/mod_ssl.so

在下面添加一行:

LoadModule php5_module C:\php\sapi\php4apache2.dll //这里php5_module是关键,如果php4_module apache就无法启动了

增加默认文件:

找到DirectoryIndex * 这行,可以这样修改,添加默认的文件名:

DirectoryIndex index.php default.php index.htm index.html default.htm default.html

保存文件,重起apache服务器。

最后,在该文件末尾加上下面两行

ScriptAlias /php/ "c:/php/"

Action application/x-httpd-php "/php/php.exe“

到此Apache的PHP环境已经完全建立了。

<3>测试:

用记事本新建个文件,写下下面几行,保存到C:\Program Files\Apache Group\Apache2\htdocs目录下,这个目录就是你的站点跟目录,命名为phpinfo.php.然后在浏览器中输入http://localhost/phpinfo.php 就可以看到想尽的关于PHP的信息了。

phpinfo.php代码如下:

phpinfo();

?>

<4>安装mysql

1.按默认安装在C:\mysql

Copy the following files to the Apache modules directory:

php\php4ts.dll

php\sapi\php4apache2.dll

php\dlls\iconv.dll

If any of these files are missing in the modules directory, Apache will fail to start.

Be sure the extension can find the following files:

php_mysql.dll

iconv.dll

libmySQL.dll

If any of them can't be found, Apache will start but will issue a warning like this: "Unknown(): Unable to load dynamic library 'c\php\extensions\php_mysql.dll" - The specified module could not be found."

php_mysql.dll should be in the extensions directory.

iconv.dll should be in the Apache modules directory.

libmySQL.dll must be either in the Apache root directory or the Windows system directory. I prefer the former because it's cleaner, as other applications don't necessarily use this MySQL library version.

Note 3: Be sure to use the libmySQL.dll file bundled with PHP. In my case, trying to use the libmySQL.dll from the MySQL 4.1 alpha package resulted in this error message: "Unknown(): Unable to load dynamic library 'c:\php\extensions\php_mysql.dll" - The specified procedure could not be found."

Start Apache and everything should be fine.

2.运行C:\mysql\bin\winmysqladmin.exe 设定user 和password

3.运行mysql,测试一下

mysql> show databases;

+-----------+

| Databases |

+-----------+

| mysql |

| test |

+-----------+

如果出现以上画面,表明mysql已经安装成功;

2.更改MySQL系統之管理者密碼(新密碼的地方,換成您要設定的密碼)

mysql> UPDATE user SET password=password('新密碼') where user='root';

3.编辑php5中的启动文件php.ini,将mysql和php5连接起来.

mysql.default_port=

mysql.default_host=

mysql.default_user=

mysql.default_password=

改为:

mysql.default_port=3306 说明的是mysql的缺省端口一般为3306

mysql.default_host=localhost 说明的是mysql的缺省主机名称

mysql.default_user=jinchao 说明的是mysql的缺省的用户名(root是最高级用户)

mysql.default_password=666666 设置管理员的口令

修改完后将apache重启,查看phpinfo页面.

<5>安装phpmyadmin

修改 C:\Program Files\Apache Group\Apache2\htdocs\phpMyAdmin\config.inc.php

查找以下这么一段:

$i = 0;

// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].

// You can disable a server config entry by setting host to ''.

在这段之后再继续查找:

找到 $cfg['Servers'][$i]['auth_type'] = 'cookie'; 將 『 config 』改為 『 cookie 』或 『 http 』

找到$cfg['Servers'][$i]['host'] = 'localhost'; 视情况做相应修改

找到$cfg['Servers'][$i]['user'] = 'root'; 视情况做相应修改

找到$cfg['Servers'][$i]['password'] = ''; 视情况做相应修改

找到$cfg['Servers'][$i]['port'] = '3306'; 视情况做相应修改

相关文章

1a1b05c64693fbf380aa1344a7812747.png

这篇文章主要介绍了input隐藏、只读和限制的属性,通过更改input的属性达到输入框限制长度和无法修改等功能,有需要的朋友可以参考下2017-08-08

4f55910a645b073bc4fc65dc10dc14bd.png

Win2003服务器安全加固设置--进一步提高服务器安全性...2007-05-05

0ea3c7666119d5615e582f823fb3fad6.png

Php部分常见问题总结...2006-07-07

4f96a78db829b1556ff16de21e013c7a.png

PHP的十个高级技巧(上中下)...2006-07-07

8cc1031babc6aff2319f1c6af8544aa0.png

php计数器的设计与实现...2006-07-07

0c932a99bb7b6f23c937db507070cc7b.png

本篇文章主要介绍了PHP 无限级分类的相关知识,具有很好的参考价值。下面跟着小编一起来看下吧2017-05-05

cca732bf65a93ed2ec0ac80c638460fe.png

生成静态页面的PHP类...2006-07-07

2d9f31f2af7b675a3d153d2b7f1035a7.png

常用表单验证类,有了这个,一般的验证就都齐了。...2006-12-12

b452cee8ec5cd9e58ab98eba17281e59.png

Firefox 包含了一个非标准的 JavaScript 扩展,使正则像函数一样可调用。这为调用正则的 exec 方法提供了便捷。例如,在 Firefox中,regex(”string”) 等同于 regex.exec(”string”)。2008-06-06

f4838ec7e2d4da28e0b57d4e852dadd4.png

最令PHP初学者头痛的十四个问题...2006-07-07

最新评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值