XAMPP配置(1):xampp-control.ini文件无法打开 及 端口占用 的问题

01 安装

下载地址:https://www.apachefriends.org/index.html
安装过程比较简单,一路next就好
安装好后,点击start,如果都是绿色,则成功
但更多时候会遇到端口冲突的问题
在这里插入图片描述

02 Apache端口占用

apche启动提示

Apache启动提示
10:33:43  [Apache]Problem detected!
10:33:43  [Apache]Port 80 in use by "Unable to open process" with PID 4!
10:33:43  [Apache]Apache WILL NOT start without the configured ports free!
10:33:43  [Apache] Youneed to uninstall/disable/reconfigure the blocking application
10:33:43  [Apache] orreconfigure Apache and the Control Panel to listen on a different port
10:33:43  [Apache]Problem detected!
10:33:43  [Apache]Port 443 in use by ""C:\Program Files (x86)\VMware\VMwareWorkstation\vmware-hostd.exe" -u "C:\ProgramData\VMware\hostd\config.xml""with PID 5728!
10:33:43  [Apache]Apache WILL NOT start without the configured ports free!
10:33:43  [Apache] Youneed to uninstall/disable/reconfigure the blocking application
10:33:43  [Apache] orreconfigure Apache and the Control Panel to listen on a different port

xampp根目录下有两个个文件properties.inixampp-control.ini

  1. 打开properties.ini,找到
[General]
installdir=D:\xampp
base_stack_name=XAMPP
base_stack_version=1.8.3-1
base_stack_platform=windows
require_root_privileges=1
[Apache]
apache_server_port=80
apache_server_ssl_port=443
apache_root_directory=/xampp/apache
apache_htdocs_directory=D:\xampp/htdocs
apache_domainname=127.0.0.1
apache_configuration_directory=D:\xampp/apache/conf
apache_unique_service_name=

将 80 修改为 8001 ;将 443 修改为 4431

apache_server_port=8001
apache_server_ssl_port=4431
  1. 打开xampp-control.ini
    找到
[ServicePorts]
Apache=80
ApacheSSL=443
MySQL=3306
FileZilla=21

修改成

Apache=8001
ApacheSSL=4431

xampp-control.ini 文件 也可以 通过 config–>service and port settings–>apache 进行修改
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


重新启动还是报错

17:05:33  [Apache] Error: Apache shutdown unexpectedly.
17:05:33  [Apache] This may be due to a blocked port, missing dependencies, 
17:05:33  [Apache] improper privileges, a crash, or a shutdown by another method.
17:05:33  [Apache] Check the "/xampp/apache/logs/error.log" file
17:05:33  [Apache] and the Windows Event Viewer for more clues

其实还是端口被占用的问题

  1. 到这个目录下\ xampp\apache\conf ,打开httpd.conf,将里边的80端口全部改成一个未被占用的端口,比如8001
  2. 到这个目录 \ xampp\apache\conf\extra ,打开httpd-ssl.conf ,将文件里的443端口全部换成一个未被占用的端口,比如4431

(可以notepad打开,ctrl+F搜索80 or 443)
(80要修改的有3处,443需要修改的有2处)

这两步也可以在Apache下选择这两个修改
在这里插入图片描述


重新启动,成功~

03 xampp-control.ini文件拒绝访问的问题

安装的时候题提示 Error:Cannot create file “C:\xampp\xampp-control.ini”. Access denied.
后面修改config的时候也这样提示

  • 可以使用管理员身份运行

  • 也可以修改这个ini文件的安全性
    ==>文件上右键属性里面看看安全选项,设置下权限,要设置为当前的用户可以完全控制的权限

04 Tomcat的无法运行问题

错误:

11:14:06  [Tomcat] 	Tomcat Started/Stopped with errors, return code: 1
11:14:06  [Tomcat] 	Make sure you have Java JDK or JRE installed and the required ports are free
11:14:06  [Tomcat] 	Check the "/xampp/tomcat/logs" folder for more information
11:38:24  [Tomcat] 	Attempting to start Tomcat app...
11:38:39  [Tomcat] 	Tomcat Started/Stopped with errors, return code: 1
11:38:39  [Tomcat] 	Make sure you have Java JDK or JRE installed and the required ports are free
11:38:39  [Tomcat] 	Check the "/xampp/tomcat/logs" folder for more information

可以参考:
https://blog.csdn.net/Tiffany_959/article/details/90536711


之前使用过jdk,所以环境变量部分没问题
之前用过Tomcat,还修改过一些东西,可能因此产生了好多奇奇怪怪的问题

运行tomcat,出现问题:

D:\Applications\XMAPP\soft\tomcat\bin>startup.bat
The CATALINA_HOME environment variable is not defined correctly
This environment variable is needed to run this program

查看环境变量"CATALINA_HOME"发现其位置不在电脑上,猜测可能是之前tomcat的安装位置
在这里插入图片描述
修改其位置到XMAPP下的tomcat里,(我xmapp的安装位置就在D:\Applications\XMAPP\soft,不是xmapp下有个文件夹 叫 soft……)
Using CATALINA_BASE: “D:\Applications\XMAPP\soft\tomcat”
Using CATALINA_HOME: “D:\Applications\XMAPP\soft\tomcat”
Using CATALINA_TMPDIR: “D:\Applications\XMAPP\soft\tomcat\temp”
Using JRE_HOME: “C:\Program Files\Java\jdk1.8.0_31”
Using CLASSPATH: “D:\Applications\XMAPP\soft\tomcat\bin\bootstrap.jar;D:\Applications\XMAPP\soft\tomcat\bin\tomcat-juli.jar”


之后运行还是出错,后来午睡完重新打开电脑,就好了~
所以如果所有方法都尝试过,不妨重启试试~
在这里插入图片描述

05 Mysql端口占用的问题

解决:https://blog.csdn.net/u014800380/article/details/52397166

06 打开xampp-control

之后每次在安装目录内找到xampp-control打开即可,不建议创建快捷方式
在这里插入图片描述

关于wamp的配置,可以看https://blog.csdn.net/qq_41866776/article/details/92850242

  • 8
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值