WIN7+XAMPP搭建PHP环境

编程知识 更新时间:2023-05-02 16:35:25

转载:http://wwwblogs/pig4870/archive/2011/08/11/2135542.html

 

WIN7+XAMPP搭建PHP环境

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

<!--[if !supportLists]-->一、<!--[endif]-->登陆xampp官网找到for windows的安装包并下载

http://www.apachefriends/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/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+XAMPP搭建PHP环境

本文发布于:2023-04-27 08:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/92968b8c47a5696df0a7d43f956a3d96.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境   XAMPP   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 106601文章数
  • 26976阅读数
  • 0评论数