安装 Apache+php+mysql+phpMyAdmin XAMPP及错误解决办法

10 篇文章 0 订阅
4 篇文章 0 订阅

Window10

需要安装 JDK,教程:https://www.cnblogs.com/asio/p/12208547.html

下载 XAMPP,官网:https://www.apachefriends.org/index.html

XAMPP 安装时一直点下一步即可。


开始启动后可能会出现报错

13:22:40 [Apache] Status change detected: running
13:22:41 [Apache] Status change detected: stopped
13:22:41 [Apache] Error: Apache shutdown unexpectedly.
13:22:41 [Apache] This may be due to a blocked port, missing dependencies,
13:22:41 [Apache] improper privileges, a crash, or a shutdown by another method.
13:22:41 [Apache] Press the Logs button to view error logs and check
13:22:41 [Apache] the Windows Event Viewer for more clues
13:22:41 [Apache] If you need more help, copy and post this

XAMPP Apache 启动失败,端口被占用 This may be due to a blocked port, missing dependencies

解决方法如下

引用自:XAMPP Apache 启动失败,端口被占用 This may be due to a blocked port, missing dependencies

从日志上分析为端口被占用,Apache 默认启动需要80 & 443 端口,

【排查方法】

1、telnet,查看端口占用情况

telnet 127.0.0.1 80 
telnet 127.0.0.1 443 

2、通过 XAMPP 面板中的 netstat 查看端口,如图
netstat

如果可以看出 443 端口被 vmware-hostd.exe占用

解决方法(两种):

1、关闭vmware-hostd.exe开启的服务,在系统服务中找到 VMware Workstation Server 服务器,关闭次服务,不会对VMware产生影响
service

2、修改XAMPP Apache conf 配置文件,修改httpd-ssl.conf 中监听443端口修改为444或者其他没占用的端口
apachessl444
总结:通过以上方法解决端口被占用 This may be due to a blocked port, missing dependencies,端口占用从很多层面科检测,本文中主要443端口被占用,如果80端口被占用,同样方法修改 httpd.conf 文件


如果还是启动失败,打开 Apache 的 error.log 日志会出现如下的信息
在这里插入图片描述
开头会发现如下信息

[Mon Feb 14 19:06:55.431814 2022] [ssl:warn] [pid 1924:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 14 19:06:55.468314 2022] [ssl:warn] [pid 1924:tid 616] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
PHP Warning: ‘vcruntime140.dll’ 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0

这个需要安装 :VC_redist.x64.exe,下载地址:https://visualstudio.microsoft.com/zh-hans/downloads/

滚动到底部 “其他工具、框架和可再发行组件” 下载如下图 **Microsoft Visual C++ Redistributable for Visual Studio xxx **,我下载的是 2022 版本
在这里插入图片描述
安装完之后重启即可


地址栏输入:http://localhost:你的端口号/dashboard/,如下图我的端口号是 80,则地址栏输入 http://localhost:80/dashboard/ 即可

在这里插入图片描述
进入后显示如下

在这里插入图片描述


强烈推荐阅读:


修改 phpMyAdmin 密码

默认密码是空的

set password for 'root'@'localhost'=password('123456');
flush privileges;

需要修改 phpmyadmin 文件夹下的配置文件,让其连接到MySQL数据库,用记事本打开 config.inc.php 文件,查找下面几个部分并修改
打开 xampp 目录
进入 phpMyAdmin 文件夹下修改 config.inc.php 即可重新访问 phpmyadmin

$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['user'] = '这里填写用户名';
$cfg['Servers'][$i]['password'] = '这里填写你的MySQL密码';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值