在 Windows 10 上安装和配置 XAMPP: (Install And Configure XAMPP on Windows 10: )每当您使用PHP编写任何网站时,您都需要能够提供PHP开发环境并帮助将后端与前端连接起来的东西。您可以使用许多软件在本地测试您的网站,例如XAMPP、MongoDB等。现在每种软件都有自己的优缺点,但在本指南中,我们将专门讨论适用于Windows 10的(Windows 10)XAMPP。在本文中,我们将了解如何在Windows 10上安装和配置(Windows 10)XAMPP。
XAMPP: XAMPP是(XAMPP: )Apache朋友开发的开源跨平台Web服务器。它最适合使用PHP开发网站的 Web 开发人员,因为它提供了一种简单的方法来安装在本地Windows 10上运行基于(Windows 10)PHP的软件(如Wordpress、Drupal等)所需的必要组件。XAMPP 省去了在设备上手动安装和配置Apache、MySQL、PHP和Perl以创建测试环境的时间和麻烦。
XAMPP中的每个字符都表示一种编程语言,XAMPP帮助安装和配置它。
X 代表跨平台的表意字母
A 代表 Apache 或 Apache HTTP 服务器
M 代表 MariaDB,即 MySQL
P 代表 PHP
P 代表 Perl(X stands as an ideographic letter which refers to cross-platform
A stands for Apache or Apache HTTP server
M stands for MariaDB which was known as MySQL
P stands for PHP
P stands for Perl)
XAMPP 还包括其他模块,如OpenSSL、phpMyAdmin、MediaWiki、Wordpress 等(OpenSSL, phpMyAdmin, MediaWiki, Wordpress and more)。一台计算机上可以存在多个XAMPP实例,您甚至可以将XAMPP从一台计算机复制到另一台计算机。XAMPP有完整版和标准版(称为较小版)。
在 Windows 10 上安装和配置 XAMPP(Install And Configure XAMPP on Windows 10)
确保 创建一个还原点(create a restore point) 以防万一出现问题。
如何在 Windows 10 上安装 XAMPP(How to Install XAMPP on Windows 10)
如果您想使用XAMPP,那么首先您需要在您的计算机上下载并安装 XAMPP(Install XAMPP),然后只有您才能使用它。要在您的计算机上下载并安装 XAMPP(Install XAMPP),请按照以下步骤操作:
1.从官方网站 Apache Friends 下载 XAMPP(Download XAMPP from official website Apache friends)或在您的网络浏览器中输入以下URL 。
2.选择要安装XAMPP的(XAMPP)PHP版本,点击前面的下载按钮。(download button)如果您没有任何版本限制,请下载最旧的版本,因为它可以帮助您避免与基于PHP的软件相关的任何问题。
3.单击“下载(Download)”按钮后,XAMPP 将开始下载。(XAMPP will start downloading.)
4.下载完成后,双击打开下载的文件。
5.当您要求允许此应用程序在您的 PC 中进行更改时( allow this app to make changes in your PC),单击是( Yes)按钮并开始安装(Installation)过程。
6.将出现以下警告对话框。单击确定(Click on the OK)按钮继续。
7.再次单击下一步按钮。( Next button.)
8.您将看到 XAMPP 允许安装的组件列表,例如MySQL、Apache、Tomcat、Perl、phpMyAdmin 等。选中您要安装的组件的复选框(Check the boxes against the components you want to install)。
注意:(Note: )建议保留默认选项并单击“下一步”(Next)按钮。
9.输入您要安装 XAMPP 软件(install XAMPP software)的文件夹位置(folder location),或通过单击地址栏旁边的小图标浏览该位置。建议使用默认位置设置来安装XAMPP软件。
10.单击下一步(Next)按钮。
11.取消选中(Uncheck) “ Learn more about Bitnami for XAMPP ”选项,然后单击Next。
注意:(Note:)如果您想了解Bitnami,则可以选中上述选项。当您单击Next时,它将在您的浏览器中打开一个Bitnami页面。
12.将出现下面的对话框,说明现在已准备好开始在您的计算机上安装XAMPP 。再次(Again)单击下一步 (Next )按钮继续。
13.单击下一步(Next)后,您将看到 XAMPP 已开始在 Windows 10 上安装(XAMPP has begun installing on Windows 10)。 等待(Wait)安装过程(Installation)完成。
14.安装完成后,会出现一个对话框,询问是否允许(14.After the installation is completed, a dialog box will appear which will ask to allow) 应用程序通过防火墙(Firewall)。单击(Click)允许访问(Allow Access)按钮。
15.单击完成按钮(Finish button)完成该过程。
注意:(Note:)如果您让“您现在要启动控制面板吗?(Do you want to start the Control Panel now?)” 选项检查,然后单击完成(Finish)后,您的XAMPP控制面板将自动打开,但如果您取消选中它,则您必须手动打开XAMPP控制面板。
16.选择您的语言,英语或德语(English or German)。默认情况下选择英语(English)并单击保存按钮。(Save button.)
17.一旦XAMPP 控制面板(XAMPP Control Panel)打开,您就可以开始使用它来测试您的程序,并可以开始 Web 服务器环境配置。
注意:(Note:)只要XAMPP运行,XAMPP图标就会出现在任务栏中。(Taskbar)
18.现在,通过单击与服务本身相对应的开始按钮( Start button)来启动一些服务,例如Apache、MySQL 。
19.一旦所有服务都成功启动,在浏览器中输入http://localhost
20.它会将您重定向到XAMPP仪表板,并且(XAMPP)XAMPP的默认页面将打开。
21.在XAMPP默认页面,点击菜单栏中的phpinfo ,查看(phpinfo)PHP的所有细节和信息。
22.在XAMPP默认页面下,点击phpMyAdmin 查看phpMyAdmin控制台。
如何在 Windows 10 上配置 XAMPP(How to configure XAMPP on Windows 10)
XAMPP控制面板(Control Panel)由几个部分组成,每个部分都有自己的意义和用途。
模块(Module)
在Module下,您将找到XAMPP提供的服务列表,无需在您的 PC 上单独安装它们。以下是XAMPP提供的服务:Apache、MySQL、FileZilla、Mercury、Tomcat。
行动(Actions)
在操作(Action)部分下,有开始(Start)和停止(Stop)按钮。您可以通过单击开始按钮(Start button)来启动任何服务。
1.如果要启动MySQL服务( start MySQL service),点击MySQL模块(MySQL module.)对应的启动按钮。(Start)
2.您的MySQL服务将启动。MySQL模块名称将变为绿色,它将确认MySQL已启动。
注意:(Note:)您也可以从以下日志中检查状态。
3.现在,如果你想停止MySQL的运行,点击MySQL 模块对应的Stop 按钮。(Stop button)
4.您的MySQL 服务将停止运行(MySQL service will stop running),其状态将变为已停止,如下面的日志所示。
端口(Port(s))
当您通过单击操作部分下的“开始”按钮启动(Start)Apache或MySQL等服务时,您将在“(MySQL)端口(Port)”部分下方看到一个与该特定服务相对应的数字。
这些数字是 每个服务在运行时使用的TCP/IP port numbers例如:在上图中,Apache使用TCP/IP Port Number 80和 443,MySQL使用 3306 TCP/IP端口号。这些端口号被认为是默认端口号。
PID (PID(s) )
当您启动模块部分下提供的任何服务时,您会看到一些数字将出现在(Module)PID 部分( PID section)下的特定服务旁边。这些数字是该特定服务的进程 ID(process ID)。计算机上运行的每个服务都有一些进程 ID。
例如:在上图中,Apache和MySQL正在运行。 Apache 的进程 ID 是 13532 和 17700,MySQL 的进程 ID 是 6064。( The process ID for Apache is 13532 and 17700 and process ID for MySQL is 6064.)
行政 (Admin )
对应于正在运行的服务,Admin按钮变为活动状态。通过单击它,您可以访问管理仪表板(administration dashboard),从中可以检查一切是否正常。
下图显示了点击MySQL 服务对应的Admin 按钮(Admin button)后将打开的屏幕。
配置(Config)
对应于模块(Module)部分下的每个服务,配置(Config)按钮可用。如果单击Config按钮,您可以轻松配置上述每个服务。
在最右侧,还有一个Config 按钮(Config button)可用。如果单击此Config按钮,则可以配置 启动(configure )XAMPP时自动启动哪些服务(which services to automatically start)。此外,还提供了一些选项,您可以根据需要和要求进行修改。
通过单击上面的配置(Config)按钮,将出现下面的对话框。
1.在模块的自动启动(Autostart)下,您可以检查您希望在XAMPP启动时自动启动的服务或模块。
2.如果你想改变XAMPP的语言,那么你可以点击 改变语言(Change Language)按钮。
3.您还可以修改服务和端口设置。(modify Service and Port Settings.)
例如:如果要更改Apache服务器的默认端口,请按照以下步骤操作:
a.单击服务(Service)和端口设置(Port Settings)按钮。
b .下面的服务设置(Service Settings)对话框将打开。
c.将Apache SSL 端口(Apache SSL Port)从 443 更改为任何其他值,例如 4433。
注意:(Note:)您应该在安全的地方记下上述端口号,因为将来可能需要它。
d.更改端口号后,单击保存按钮。( Save button.)
e.现在单击XAMPP 控制面板中(XAMPP Control Panel)模块(Module)部分下的Apache旁边的配置按钮(Config button)。
f.从上下文菜单中单击Apache (httpd-ssl.conf) 。
g.在刚刚打开的文本文件下搜索“ Listen ”,并将您之前在步骤c中记下的端口值更改为。这里将是 4433,但在你的情况下,它会有所不同。
h.同时寻找<VirtualHost _default_:previous port number>。将端口号更改为新的端口号。在这种情况下,它看起来像<VirtualHost _default_:4433>
i.保存更改。
4. 进行更改后,单击“保存”按钮。(Save button.)
5.如果您不想保存更改,请单击“中止”按钮( Abort button),您的 XAMPP 将回滚到以前的状态。
网络统计(Netstat)
在最右侧,Config按钮下方,Netstat 按钮(Netstat button)可用。如果您单击它,它将为您提供当前运行并访问哪个网络的服务或套接字列表、它们的进程 ID 和TCP/IP端口信息。
列表将分为三个部分:
贝壳(Shell)
在最右侧,Netstat按钮下方,Shell 按钮(Shell button)可用。如果单击Shell按钮,它将打开 shell 命令行实用程序,您可以在其中键入命令以访问服务、应用程序、文件夹等。
探险家(Explorer)
在Shell(Shell)按钮下方,有一个Explorer按钮,点击它可以在File Explorer中打开(File Explorer)XAMPP文件夹,可以看到XAMPP的所有可用文件夹。
服务(Services)
如果您单击资源管理器(Explorer)按钮下方的“服务(Services)”按钮,它将打开“ 服务(Services)”对话框,其中将为您提供计算机上运行的所有服务的详细信息。
帮助(Help)
通过单击“服务(Service)”按钮下方的“帮助(Help)”按钮,您可以通过单击可用链接来查找所需的任何帮助。
辞职(Quit)
如果要退出XAMPP 控制面板(XAMPP Control Panel),请单击“帮助(Help)”按钮下方最右侧的“退出( Quit button)”按钮。
日志部分(Log Section)
在XAMPP 控制面板(XAMPP Control Panel)的底部,显示一个日志框,您可以在其中查看当前正在运行的活动,正在运行的XAMPP服务面临哪些错误。它将为您提供有关启动服务或停止服务时发生的情况的信息。此外,它将为您提供有关在XAMPP(XAMPP)下发生的每项操作的信息。这也是出现问题时首先要看的地方。
大多数时候,您的 XAMPP 将使用默认设置完美地工作,以创建一个测试环境来运行您创建的网站。但是,有时根据端口的可用性或您的设置配置,您可能需要change the TCP/IP port号或设置 phpMyAdmin 的密码。
要更改这些设置,请使用与您要更改的服务对应的配置按钮并保存更改,您将可以很好地使用 XAMPP 及其提供的其他服务。(Config)
受到推崇的:(Recommended:)
我希望这篇文章对您有所帮助,您现在可以轻松地 在 Windows 10 上安装和配置 XAMPP (Install And Configure XAMPP on Windows 10), 但是如果您对本教程仍有任何疑问,请随时在评论部分提出。
Install And Configure XAMPP on Windows 10
Install And Configure XAMPP on Windows 10: Whenever you code any website in PHP you will need something that can provide a PHP development environment and help connect the backend with the front end. There are many software’s which you can use to locally test your website such as XAMPP, MongoDB, etc. Now each software has its own advantages and disadvantages but in this guide, we will specifically talk about XAMPP for Windows 10. In this article, we will see how one can install and configure XAMPP on Windows 10.
XAMPP: XAMPP is an open source cross-platform web server developed by Apache friends. It is best for web developers who develop websites using PHP as it provides an easy way to install the necessary components required to run PHP based software like Wordpress, Drupal, etc on Windows 10 locally. XAMPP saves the time and frustration of manually installing and configuring Apache, MySQL, PHP, and Perl on the device to create a test environment.
Each character in word XAMPP signifies one programming language which XAMPP helps to install and configure.
X stands as an ideographic letter which refers to cross-platform
A stands for Apache or Apache HTTP server
M stands for MariaDB which was known as MySQL
P stands for PHP
P stands for Perl
XAMPP also includes other modules like OpenSSL, phpMyAdmin, MediaWiki, Wordpress and more. Multiple instances of XAMPP can exist on one computer and you can even copy XAMPP from one computer to another. XAMPP is available in both full and standard version called the smaller version.
Install And Configure XAMPP on Windows 10
Make sure to create a restore point just in case something goes wrong.
How to Install XAMPP on Windows 10
If you want to use XAMPP then first you need to download and Install XAMPP on your computers then only you will be able to use it. To download and Install XAMPP on your computers follow the below steps:
1.Download XAMPP from official website Apache friends or type the below URL in your web browser.
2.Choose the version of PHP for which you want to install XAMPP and click on the download button in front of it. If you do not have any version restrictions then download the oldest version as it may help you to avoid any issues related to PHP based software.
3.As soon as you click the Download button, XAMPP will start downloading.
4.When the download is completed, open the downloaded file by double-clicking on it.
5.When you will ask to allow this app to make changes in your PC, click on the Yes button and start the Installation process.
6.Below warning dialog box will appear. Click on the OK button to continue.
7.Again click on the Next button.
8.You will see a list of components that XAMPP allows to install such as MySQL, Apache, Tomcat, Perl, phpMyAdmin, etc. Check the boxes against the components you want to install.
Note: It is recommended to leave the default options checked and click on the Next button.
9.Enter the folder location where you want to install XAMPP software or browse through the location by clicking on small icon available next to the address bar. It is recommended to use the default location settings to install XAMPP software.
10.Click on Next button.
11.Uncheck “Learn more about Bitnami for XAMPP” option and click Next.
Note: If you want to learn about Bitnami then you can remain the above option checked. It will open a Bitnami page in your browser when you will click Next.
12.The below dialog box will appear saying that the setup is now ready to begin installing XAMPP on your computer. Again click on Next button to continue.
13.Once you click Next, you will see XAMPP has begun installing on Windows 10. Wait for the Installation process to complete.
14.After the installation is completed, a dialog box will appear which will ask to allow the app through the Firewall. Click on the Allow Access button.
15.Click on the Finish button to complete the process.
Note: If you let the “Do you want to start the Control Panel now?” option check then after clicking Finish your XAMPP control panel will open up automatically but if you unchecked it then you have to manually open the XAMPP control panel.
16.Choose your language either English or German. By default English is selected and click on the Save button.
17.Once the XAMPP Control Panel opens up, you can start using it to test your programs and can begin the web server environment configuration.
Note: The XAMPP icon will appear in the Taskbar whenever XAMPP is running.
18.Now, start some services like Apache, MySQL by clicking on Start button corresponding to the service itself.
19.Once all the services have started successfully, open localhost by typing http://localhost in your browser.
20.It will redirect you to the XAMPP dashboard and the default page of the XAMPP will open.
21.From the XAMPP default page, click on phpinfo from the menu bar to see all the details and information of PHP.
22.Under the XAMPP default page, click on phpMyAdmin to see the phpMyAdmin console.
How to configure XAMPP on Windows 10
XAMPP Control Panel consists of several sections and each section has its own significance and use.
Module
Under Module, you will find a list of services provided by the XAMPP and there is no need to install them separately on your PC. The following are the services provided by XAMPP: Apache, MySQL, FileZilla, Mercury, Tomcat.
Actions
Under Action section, Start and Stop buttons are there. You can start any service by clicking on the Start button.
1.If you want to start MySQL service, click on the Start button corresponding to the MySQL module.
2.Your MySQL service will start. The MySQL module name will become green and it will confirm that MySQL has started.
Note: Also you can check the status from the below logs.
3.Now, if you want to stop MySQL from running, click on the Stop button corresponding to the MySQL module.
4.Your MySQL service will stop running and its status will become stopped as you can see in the logs below.
Port(s)
When you will start services like Apache or MySQL by clicking on the Start button under the action section, you will see a number below the Port(s) section and corresponding to that particular service.
These numbers are TCP/IP port numbers which each service uses when they are running. For example: In the above figure, Apache is using TCP/IP Port Number 80 and 443 and MySQL is using 3306 TCP/IP port number. These port numbers are considered to be there default port numbers.
PID(s)
When you will start any service provided under the Module section, you will see some numbers will appear next to that particular service under the PID section. These numbers are the process ID for that particular service. Each service running on the computer has some process ID.
For example: In the above figure, Apache and MySQL are running. The process ID for Apache is 13532 and 17700 and process ID for MySQL is 6064.
Admin
Corresponding to the running services, the Admin button becomes active. By clicking on it you can get access to the administration dashboard from where you can check if everything is working correctly or not.
Below figure shows a screen which will open up after clicking at Admin button corresponding to MySQL service.
Config
Corresponding to each service under the Module section, Config button is available. If you click on the Config button, you can easily configure each of the above services.
At the extreme right side, one more Config button is available. If you click on this Config button then you can configure which services to automatically start when you launch XAMPP. Also, some options are available which you can modify according to your need and requirements.
By clicking on above Config button, below dialog box will appear.
1.Under Autostart of modules, you can check the services or modules which you want to start automatically when XAMPP is launched.
2.If you want to change the language of XAMPP then you can click on the Change Language button.
3.You can also modify Service and Port Settings.
For example: If you want to change the default port for Apache server follow the below steps:
a.Click on Service and Port Settings button.
b.Below Service Settings dialog box will open up.
c.Change the Apache SSL Port from 443 to any other value like 4433.
Note: You should note down the above port number somewhere safe as it may be needed in the future.
d.After changing the port number, click on the Save button.
e.Now click on the Config button next to Apache under the Module section in XAMPP Control Panel.
f.Click on Apache (httpd-ssl.conf) from the context menu.
g.Search for “Listen” under the text file which just opened and change the port value to which you earlier noted in step c. Here it will be 4433 but in your case, it will be different.
h.Also look for <VirtualHost _default_:previous port number>. Change the port number to the new port number. In this case, it will look like <VirtualHost _default_:4433>
i.Save the changes.
4.After making changes, click on the Save button.
5.If you do not want to save the changes then click on the Abort button and your XAMPP will roll back to the previous state.
Netstat
On the extreme right side, below the Config button, Netstat button is available. If you will click on it, it will give you a list of services or sockets currently running and accessing which network, their process ID and TCP/IP port information.
List will be divided into three parts:
- Active Sockets/Services
- New Sockets
- Old Sockets
Shell
On the extreme right side, below the Netstat button, Shell button is available. If you click on the Shell button then it would open the shell command line utility where you can type commands to access the services, apps, folders, etc.
Explorer
Below the Shell button, there is an Explorer button, by clicking on it you can open the XAMPP folder in File Explorer and can see all the available folders of XAMPP.
Services
If you click on the Services button below the Explorer button, it will open the Services dialog box which will give you the details of all the services running on your computer.
Help
By clicking on Help button present below the Service button, you can look for any help you want by clicking on the available links.
Quit
If you want to exit from XAMPP Control Panel, then click on the Quit button available on the extreme right side below the Help button.
Log Section
At the bottom of the XAMPP Control Panel, present a box of logs where you can see which activities are currently running, what errors are faced by the running services of XAMPP. It will provide you with information on what happens when you start a service or when you stop service. Also, it will provide you information regarding each and every action taking place under XAMPP. This is also the first place to look when something goes wrong.
Most of the times, your XAMPP will work perfectly using the default settings to create a testing environment to run the website you have created. However, sometimes depending on the availability of port or your setup configuration you may need to change the TCP/IP port number of the running services or set the password for phpMyAdmin.
To change these settings, use the Config button corresponding to the service for which you want to make changes and save the changes and you will be good to use the XAMPP and the other services provided by it.
Recommended:
I hope this article was helpful and you can now easily Install And Configure XAMPP on Windows 10, but if you still have any questions regarding this tutorial then feel free to ask them in the comment’s section.