WIN7+XAMPP搭建PHP环境

简介:这是WIN7+XAMPP搭建PHP环境的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=343929' scrolling='no'>

尝试在Win7旗舰版SP1 64位系统装一下XAMPP,准备学习PHP,一边操作,一边做笔记把好奇的东西都记下来。

一、登陆xampp官网找到for windows的安装包并下载

http://www.apachefriends.org/zh_cn/xampp-windows.html


下载之后是这样子:


打开程序安装XAMPP,一直默认下一步





我安装在D盘的XAMPP目录下,继续下一步


前两个是新建桌面图标和开始菜单的快捷方式,后三个是后台的服务,我都勾上了



提示服务安装完成


YES打开XAMPP控制面板



这个是控制面板,Apache和MySql的服务要开着


进入MySQL控制台设置数据库的密码

http://localhost/security/xamppsecurity.php

设置完之后就登陆

http://localhost/phpmyadmin

我设的账号为root,密码:123456


登陆完之后页面底部提示如下:


phpmyadmin链接表的附加功能尚未激活。要查出原因,请点击此处

phpmyadmin版本v3以上的好像都会有这个问题

以下为网上转载的解决方法:

第一步:使用Mysql治理员帐号通过phpmyadmin登陆,然后点击“导进”,然后点击“浏览”按钮,找到phpmyadmin文件夹下的scripts文件夹里的一个名为create_tables.sql的文件。把它导进就OK了。

附网上解决方法补充(把phpmyadmin目录下scripts/create_tables_mysql_4_1_2+.sql(根据版本选择,如果mysql版本小于4.1.2,就使用create_tables.sql)如果提示错误,可以先导入create_tables.sql,然后再导入一次create_tables_mysql_4_1_2+.sql。我用3.38版 没有这一步操作,也能解决问题)

第二步:打开phpmyadmin文件夹下的libraries文件夹,找到名为config.default.php的文件,使用文本编辑工具(不推荐使用记事本,建议使用Dreamweaver之类的工具)打开该文件。对其进行修改。

V3.38版本直接在根目录修改config.inc.php进行修改。

修改的内容并非连续的,请手动进行修改,请勿复制。

修改前的内容:

$cfg['Servers'][$i]['pmadb']=”;

$cfg['Servers'][$i]['bookmarktable']=”;

$cfg['Servers'][$i]['relation']=”;

$cfg['Servers'][$i]['table_info']=”;

$cfg['Servers'][$i]['table_coords']=”;

$cfg['Servers'][$i]['pdf_pages']=”;

$cfg['Servers'][$i]['column_info']=”;

$cfg['Servers'][$i]['history']=”;

$cfg['Servers'][$i]['designer_coords']=”;

$cfg['Servers'][$i]['tracking']=”;

修改后的内容:

$cfg['Servers'][$i]['pmadb']=‘phpmyadmin’;

$cfg['Servers'][$i]['bookmarktable']=‘pma_bookmark’;

$cfg['Servers'][$i]['relation']=‘pma_relation’;

$cfg['Servers'][$i]['table_info']=‘pma_table_info’;

$cfg['Servers'][$i]['table_coords']=‘pma_table_coords’;

$cfg['Servers'][$i]['pdf_pages']=‘pma_pdf_pages’;

$cfg['Servers'][$i]['column_info']=‘pma_column_info’;

$cfg['Servers'][$i]['history']=‘pma_history’;

$cfg['Servers'][$i]['designer_coords']=‘pma_designer_coords’;

$cfg['Servers'][$i]['tracking']=‘pma_tracking’;

将libraries/config.default.php中的$cfg['PmaAbsoluteUri']改为

$cfg['PmaAbsoluteUri'] = ‘http://127.0.0.1/phpmyadmin/‘; 

第三步:注销phpmyadmin之后并重新登录。大功告成!

来自: http://hi.baidu.com/netdp/blog/item/6d6ec224c849147235a80f78.html


下面开始hello world

在xampp/htdocs目录下新建一个helloworld.php文件,记得是UTF8编码。

<html>

<head>

<title>Hello World</title>

</head>

<body>

<?php

echo "Hello World";

?>

</body>

</html>

 

 然后浏览器访问

http://localhost/helloworld.php


最后发现WIN7 64位系统也能正常运行PHP,此文仅为个人笔记,不足之处,请指出

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/343929.html pageNo:5

posted on 2011-11-09 08:17  圣者  阅读(235)  评论(0编辑  收藏  举报

导航