search
HomeBackend DevelopmentPHP TutorialXAMPP安装与使用方法详细解析_PHP

XAMPP

XAMPP 是一个把Apache网页服务器与PHP、Perl及MySQL集合在一起的安装包,允许用户可以在自己的电脑上轻易的建立网页服务器。使用 XAMPP 您可以轻松的在本机调试您的 PHP 程序、CMS以及 wordpress 博客程序。本文主要分享一下 XAMPP 的使用教程。

XAMPP 使用方法
1.下载 XAMPP
首先下载 XAMPP ,您可以在本页面下方提供的链接直接点入官方网站下载。

2.安装 XAMPP
我使用的是 XAMPP 的 Windows 版的安装包,下载后直接安装即可,安装过程所有选项保持默认即可。建议不要直接装在 C 盘。安装过程结束后,您会在 开始/程序/XAMPP 菜单下找到 XAMPP。您可以使用 XAMPP 控制面板来启动/停止所有服务或安装/卸载所有服务。



3.配置 XAMPP
在浏览器里输入:http://localhost  或者 http://127.0.0.1  即可看到 XAMPP 欢迎界面。如果出现错误请查看您在以前是否安装过类似软件 ,如 dedecms 的 dedeampz,并存可以有些冲突,停止这些软件的运行或者直接卸载即可。

4.修改phpMyAdmin配置
首先用相关软件打开位于D:/xampp/phpMyAdmin 文件夹中的config.inc.php文件。
搜索
复制代码 代码如下:
$cfg

[

'Servers'

]

[

$i

]

[

'auth_type'

]

 =

 'config'

;

将其中的config (系缺省值)更改为cookie 保存。

5.登陆 XAMPP
通过默认主页 http://localhost 左侧的phpmyadmin导航栏进入phpmyadmin界面,可直接通过http: //localhost/phpmyadmin/ 进入web登陆界面,输入用户名root后直接点击登陆(密码默认为空)即可。
注:在默认状态下,phpmyadmin有两个用户名,分别是pma和root。其中,root是管理员身份,而pma则是普通用户身份,但二者在缺省状态下均无密码。

6.建立新的管理员帐号及删除原有的root帐号
首先进入权限选项卡,点击root帐号编辑其权限,在最底端的只输入相应的用户名和密码,其余选项保持其缺省值,确认后即可产生与原有root帐号相同权限的新帐号;随后,再次编辑root帐号的权限,并在最底端的更改登录信息/复制用户中选择“从用户表中删除旧用户”,其余选项不变,确认后即可删除原有的root帐号。园子这样操作也是为了安全性考虑,不推荐使用root用户,最好新建一个具有所有功能的用户来管理数据库。

7.更改pma帐号密码
与root相似,但是,当更改其帐号后会有出错信息,此时,用相关软件将config.inc.php第63行的pma密码更改与 web设置相对应,此时,登陆就不会再出错了。pma密码可以不填。不用他就好了。

经过上述的配置后 xampp 的基本配置已经完成了,请记住您的站点根目录为 xampp 目录下的 htdocs 文件夹。您可以在 htdocs 目录下创建任意一个站点。例如将 test.html 放在 ./xampp/htdocs/new 路径下,您就可以在浏览器的地址栏中输入 http://localhost/new/test.html 来访问这个文件。

需要注意的问题
1.root等管理员密码无需在config.inc.php中更改。

2.只有pma不设置密码时,XAMPP主界面的MySQL database的状态才会显示为ACTIVATED状态!

3.不要使用XAMPP for Windows Version 1.5.2自带的mysql管理软件来设置。如果设置了,会在C:/windowns目录下产生一个my.ini文件。如果要重新安装,则需要将此my.ini文件删除,以免影响后续设置。

4.必要时请更改默认端口,APACHE的默认端口是80,如果你装有IIS,就会有冲突。所以,要更改一个端口。打开xampp/apache/conf/httpd.conf,把 listen 80 改为其它的端口,如99,8080等等。

5.您可能会遇到安装了xampp,在本机通过localhost和ip都可以访问,但是局域网其它机器不能访问的问题。解决方法是:修改 xampp/apache/httpd.conf,把Listen 80改成Listen 192.168.0.188:80,192.168.0.188换成您服务器的ip。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP's Current Status: A Look at Web Development TrendsPHP's Current Status: A Look at Web Development TrendsApr 13, 2025 am 12:20 AM

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

PHP vs. Other Languages: A ComparisonPHP vs. Other Languages: A ComparisonApr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP vs. Python: Core Features and FunctionalityPHP vs. Python: Core Features and FunctionalityApr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP: A Key Language for Web DevelopmentPHP: A Key Language for Web DevelopmentApr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP: The Foundation of Many WebsitesPHP: The Foundation of Many WebsitesApr 13, 2025 am 12:07 AM

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

Beyond the Hype: Assessing PHP's Role TodayBeyond the Hype: Assessing PHP's Role TodayApr 12, 2025 am 12:17 AM

PHP remains a powerful and widely used tool in modern programming, especially in the field of web development. 1) PHP is easy to use and seamlessly integrated with databases, and is the first choice for many developers. 2) It supports dynamic content generation and object-oriented programming, suitable for quickly creating and maintaining websites. 3) PHP's performance can be improved by caching and optimizing database queries, and its extensive community and rich ecosystem make it still important in today's technology stack.

What are Weak References in PHP and when are they useful?What are Weak References in PHP and when are they useful?Apr 12, 2025 am 12:13 AM

In PHP, weak references are implemented through the WeakReference class and will not prevent the garbage collector from reclaiming objects. Weak references are suitable for scenarios such as caching systems and event listeners. It should be noted that it cannot guarantee the survival of objects and that garbage collection may be delayed.

Explain the __invoke magic method in PHP.Explain the __invoke magic method in PHP.Apr 12, 2025 am 12:07 AM

The \_\_invoke method allows objects to be called like functions. 1. Define the \_\_invoke method so that the object can be called. 2. When using the $obj(...) syntax, PHP will execute the \_\_invoke method. 3. Suitable for scenarios such as logging and calculator, improving code flexibility and readability.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools