PHP学习笔记01——XAMPP安装

来源:互联网 发布:北京网页游戏编程培训 编辑:程序博客网 时间:2024/06/10 16:10

XAMPP介绍

XAMPP is a free and open source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages. XAMPP stands for Cross-Platform (X), Apache (A), MariaDB (M), PHP (P) and Perl (P). It is a simple, lightweight Apache distribution that makes it extremely easy for developers to create a local web server for testing and deployment purposes. Everything needed to set up a web server – server application (Apache), database (MariaDB), and scripting language (PHP) – is included in an extractable file. XAMPP is also cross-platform, which means it works equally well on Linux, Mac and Windows. Since most actual web server deployments use the same components as XAMPP, it makes transitioning from a local test server to a live server extremely easy as well.

简单来说,xampp就是一个跨平台的,包含了Apache、MariaDB、PHP和Perl的集成软件包。
通过使用这个来学习简单的建站。
然后我就要开始使用这种易用的集成包来学PHP了!


XAMPP下载地址

https://www.apachefriends.org/download.html
因为我使用的是WIN10系统,所以我的内容都是关于Windows的。
根据版本号判断最下边那个是最新的,点击下载即可(PS:好像Windows只有32位的?)。
下载完之后就开始安装,我是直接按照默认的安装所以就不给什么建议了2333。


启动Apache和MySQL

首先在安装目录下找到xampp-control.exe并双击运行,
然后点击”Start”运行Apache和MySQL。


运行之后长这样↓
PID(s)是进程号,每次启动都不一样但是是唯一的。
Port(s)是端口,默认端口,也可自行修改。


测试

运行了Apche和MySQL后,通过这个网站 → http://localhost/dashboard/ 来测试你的Web服务器是否运行。
如果你能访问这个网址并显示下图的内容,那么你已经成功安装好了xampp。


补充

因为刚装好的MySQL默认没有密码,可以根据 http://localhost/dashboard/docs/reset-mysql-password.html 提供的帮助来为MySQL管理员用户设置密码。
我也在这分享一下我折腾了半天之后完成的修改办法。

  1. 在 http://localhost/dashboard/ 页面下(刚才的测试页面),点击右上角的phpMyAdmin进入管理页面


  2. 点击账户,将会显示用户账户概况;
    选择要修改权限的账户,点击修改权限-修改密码
    可以自己设定密码,也可以直接生成密码
    记得点击右下角的执行来完成设置


  3. 修改并测试
    从 xampp-control.exe 面板启动Shell
    通过 mysql -uroot -p ,接着输入密码来进入数据库


    如果成功进入则进行下一步
    修改该目录下的配置文件,如图


    用记事本或别的文本编辑器打开
    $cfg['Servers'][$i]['password'] = '';设置为管理员root的密码
    $cfg['Servers'][$i]['controlpass'] = '114590'; 设置为用户的密码
    再次从 http://localhost/dashboard/ 页面,点击右上角的phpMyAdmin进入管理页面
    (解决办法参考:http://blog.csdn.net/quincylk/article/details/50562399)

现在xampp里的东西基本配置完了,接下来就可以开始写php文件了!
若哪里有错误尽管告诉我qxq