﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-zhentyn-随笔分类-PHP&amp;Mysql编程 </title><link>http://www.cnitblog.com/zhentyn/category/2575.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 27 Sep 2011 15:38:05 GMT</lastBuildDate><pubDate>Tue, 27 Sep 2011 15:38:05 GMT</pubDate><ttl>60</ttl><item><title>安装PHPLIB</title><link>http://www.cnitblog.com/zhentyn/archive/2006/06/06/11709.html</link><dc:creator>果园</dc:creator><author>果园</author><pubDate>Tue, 06 Jun 2006 10:52:00 GMT</pubDate><guid>http://www.cnitblog.com/zhentyn/archive/2006/06/06/11709.html</guid><wfw:comment>http://www.cnitblog.com/zhentyn/comments/11709.html</wfw:comment><comments>http://www.cnitblog.com/zhentyn/archive/2006/06/06/11709.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhentyn/comments/commentRss/11709.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhentyn/services/trackbacks/11709.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; TEXT-ALIGN: center; mso-line-height-rule: exactly" align="center">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 16pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">安装</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 16pt; FONT-FAMILY: 'Trebuchet MS'">PHPLIB<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; TEXT-ALIGN: right; mso-line-height-rule: exactly" align="right">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">By </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">翟翔</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">从</span>
				<span lang="EN-US" style="COLOR: black; FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<a href="http://www.sanisoft.com/phplib/download.php下载最新版phplib-7.4">
								<span style="COLOR: black">http://www.sanisoft.com/phplib/download.php</span>
								<span lang="EN-US" style="COLOR: black; FONT-FAMILY: 宋体; TEXT-DECORATION: none; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; text-underline: none">
										<span lang="EN-US">下载最新版</span>
								</span>
								<span style="COLOR: black; TEXT-DECORATION: none; text-underline: none">phplib-7.4</span>
						</a>
				</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">将其解压缩到</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">APACHE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">的根目录下，如</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">编辑</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">C:\<a class="wordstyle" href="http://www.newasp.cn/" target="_blank">WINDOWS</a></span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">php.ini</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">文件</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">搜索</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">auto_prepend_file = <o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">在后面添加</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">"D:\Apache Group\Apache2\PHPLIB\php\prepend.php3"<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">搜索</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">include_path =<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">在后面添加</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">"D:\Apache Group\Apache2\PHPLIB\php"<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">使用</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">phpmyadmin</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">创建一个数据库，如</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">phplib<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">在数据库</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt"> phplib </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">运行</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt"> SQL</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">通过文本文件的位置</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\PHPLIB\stuff</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">create_database.mysql<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">编辑</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\PHPLIB\php</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">prepend.php3<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">搜索</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">require($_PHPLIB["libdir"] .</span>
				<span lang="EN-US" style="mso-hansi-font-family: 'Trebuchet MS'">
				</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">"db_mysql.inc");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">将其改为</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">require("db_mysql.inc");<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">编辑</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\PHPLIB\php</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">local.inc<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">搜索</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">class DB_Example extends DB_Sql<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">更改其中的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">4</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">个变量值</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 10.5pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly; mso-char-indent-count: 1.0">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">var $Host<span style="mso-spacerun: yes">     </span>= "localhost";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $Database = "phplib";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $User<span style="mso-spacerun: yes">     </span>= "root";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $Password = "";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">使其满足你新建的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">phplib</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">数据库</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">同理，编辑</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\PHPLIB\php</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">db_mysql.inc<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">搜索</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">class DB_Sql<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">更改其中的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">4</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">个变量值</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 10.5pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly; mso-char-indent-count: 1.0">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">var $Host<span style="mso-spacerun: yes">     </span>= "localhost";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $Database = "phplib";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $User<span style="mso-spacerun: yes">     </span>= "root";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<span style="mso-spacerun: yes">  </span>var $Password = "";<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">使其满足你新建的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">phplib</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">数据库</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">将</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\PHPLIB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">下的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">pages</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">文件夹复制到</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">APACHE</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">htdocs</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">目录下，如</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">D:\Apache Group\Apache2\htdocs<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">浏览</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">
						<a href="http://localhost/pages/showoff.php3">http://localhost/pages/showoff.php3</a>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 21pt; mso-line-height-rule: exactly">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">默认的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'; mso-bidi-font-size: 10.5pt">username: kris<span style="mso-tab-count: 2">        </span>password: test<o:p></o:p></span>
		</p>
<img src ="http://www.cnitblog.com/zhentyn/aggbug/11709.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhentyn/" target="_blank">果园</a> 2006-06-06 18:52 <a href="http://www.cnitblog.com/zhentyn/archive/2006/06/06/11709.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows环境下的Apache用户验证</title><link>http://www.cnitblog.com/zhentyn/archive/2006/05/15/10561.html</link><dc:creator>果园</dc:creator><author>果园</author><pubDate>Mon, 15 May 2006 10:34:00 GMT</pubDate><guid>http://www.cnitblog.com/zhentyn/archive/2006/05/15/10561.html</guid><wfw:comment>http://www.cnitblog.com/zhentyn/comments/10561.html</wfw:comment><comments>http://www.cnitblog.com/zhentyn/archive/2006/05/15/10561.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhentyn/comments/commentRss/10561.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhentyn/services/trackbacks/10561.html</trackback:ping><description><![CDATA[Windows环境下的Apache用户验证<br /><br />今天试了很久才试出来。也找了一些资料。<br />参考：<br /><a href="http://doc.chinahtml.com/Manual/ApacheManual/howto/auth.html">http://doc.chinahtml.com/Manual/ApacheManual/howto/auth.html</a><br /><br />如下例：<br />   &lt;Directory "D:\www.abc.com.cn\admin"&gt;<br />      AuthType Basic<br /> AuthName "sagitar Web admin"<br /> AuthUserFile "C:\Program Files\Apache Group\Apache2\conf\htpasswd"<br /> Satisfy All<br /> require user abcuser<br />    &lt;/Directory&gt;<br /><br />可以在httpd.conf中添加认证的路径，也可以在被认证的目录下添加.htaccess文件。具体的做法如下。<br /><br /><br />方法一：以单用户方式实现某目录只能由某个用户或几个用户访问。<br />假设Apache的web根目录为 d:/home，对应URL为 http://localhost/<br />如欲使d:/home/test目录只能由某用户访问，该目录对应URL为http://localhost/test，访问该URL时需要弹出验证对话框。<br />d:/users目录用来存放密码文件 user.passwd<br /><br />1、制作用户密码文件<br />在命令行方式先用Apache自带的工具htpasswd.exe生成一个密码文件叫user.passwd，-c参数表示新建文件，无参数表示在该口令文件中以添加方式增加一个用户。<br />D:\apache\bin&gt;htpasswd -bc d:/users/user.passwd user1 123456<br />这样，就生成了d:/users/user.passwd 口令文件，里面有一行文字 user1:$apr1$4S3.....$.su.8AIrDEYMX7jKv2RT9/<br />成功增加了一个user1的用户，如果想再添加其他用户，就采用追加方式添加用户：<br />D:\apache\bin&gt;htpasswd -b d:/users/user.passwd user2 123456<br />D:\apache\bin&gt;htpasswd -b d:/users/user.passwd user3 123456<br /><br />好了，当添加完用户，就可以着手实现用户验证了。<br /><br />2、制作访问验证文件 .htaccess<br />打开记事本，输入以下文字：<br /><br />authtype basic<br />authname "www.home.net"<br />authuserfile d:/users/users.passwd<br />require user user1<br /><br />然后另存为 .htaccess，保存路径为你想实现验证的目录：d:/home/test/下，注意保存类型选"所有文件"，文件名为".htaccess"，否则就不会生成 .htaccess 文件了。<br /><br />到这里，指定某个用户验证的设置就完成了，在浏览器中输入验证目录所对应的地址 http://localhost/test/，会发现浏览器弹出一个对话框要求你输入用户名和口令，你就只能输入用户user1和密码12345才能进去，输入其他用户如user2,user3是没用的。<br /><br />3、实现指定某几个用户对一个目录的验证<br />例如决定 http://localhost/test/ 能由user1和user3访问，user2不能访问，则编辑 d:/home/test/.htaccess 文件，把最后的一句：<br />require user user1<br />改为：<br />require user user1 user3<br />如此就实现了 http://localhost/test/ 只能由user1和user2访问<br /><br />4、实现所有合法用户对一个目录的验证<br />例如决定 http://localhost/test/ 能由 d:/users/user.passwd 文件里的所有用户访问，则编辑 d:/home/test/.htaccess 文件，把最后的一句改为 ： <br /><br />require valid-user<br /><br />就可以实现在 user.passwd 里用户都能访问http://localhost/test/了，只要输入的用户名和密码没有错误。<br /><br />方法二：采用群组用户方式实现验证<br />要实现其实也很简单，在方法一中对 user.passwd 文件里的用户进行分组，建立用户组文件，再在 .htaccess 文件里指定 authgroupfile 就可以了。假设 user.passwd 中已经添加了很多用户 (user1,user2,user3,user4,...)<br />1、建立一个用户组文件 d:/users/user.group ，内容如下：<br /><br />manager:user1 user3<br />game:user2 user4<br />download:user5 user6 user7<br /><br />如此，user.group 文件里把 user1至user7这7个用户分为了3个组：manager，game，download 。<br /><br />2、实现某组用户能访问 http://localhost/test/<br />编辑 d:/home/test/.htaccess 文件，内容如下：<br /><br />authtype basic<br />authname "www.home.net"<br />authuserfile d:/users/users.passwd<br />authgroupfile d:/users/user.group<br />require group game<br /><br />那么，http://localhost/test/就只能由 game组里的用户 user2，user4 才能访问了。<br /><br />以上步骤，对于熟悉编程开发的同志来说，完全可以做个图形界面程序来完成，就省事多了。<br />至此，Apache在Win32环境下的简单验证就实现了。看来和 Linux下的设置方法差不多，我却走了不少弯路才摸索出来，惭愧惭愧啊。<br />实现Apache的验证方法还有数种途径，以上只是一方面而已。<br /><img src ="http://www.cnitblog.com/zhentyn/aggbug/10561.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhentyn/" target="_blank">果园</a> 2006-05-15 18:34 <a href="http://www.cnitblog.com/zhentyn/archive/2006/05/15/10561.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>