mysql - Apache 未启动如何解决此错误;本地主机数据库不工作

标签 mysql apache phpmyadmin xampp

我退出了 Skype,虽然端口相同,但仍然无法工作.. 我尝试重新启动我的电脑并重新启动 Xamppp。但不工作。

   8:47:28 PM  [Apache] 	Attempting to start Apache app...
    8:47:28 PM  [Apache] 	Status change detected: running
    8:47:28 PM  [Apache] 	Status change detected: stopped
    8:47:28 PM  [Apache] 	Error: Apache shutdown unexpectedly.
    8:47:28 PM  [Apache] 	This may be due to a blocked port, missing dependencies, 
    8:47:28 PM  [Apache] 	improper privileges, a crash, or a shutdown by another method.
    8:47:28 PM  [Apache] 	Press the Logs button to view error logs and check
    8:47:28 PM  [Apache] 	the Windows Event Viewer for more clues
    8:47:28 PM  [Apache] 	If you need more help, copy and post this
    8:47:28 PM  [Apache] 	entire log window on the forums
    8:47:30 PM  [Apache] 	Problem detected!
    8:47:30 PM  [Apache] 	Port 80 in use by "Unable to open process" with PID 4!
    8:47:30 PM  [Apache] 	Apache WILL NOT start without the configured ports free!
    8:47:30 PM  [Apache] 	You need to uninstall/disable/reconfienter code heregure the blocking application
    8:47:30 PM  [Apache] 	or reconfigure Apache and the Control Panel to listen on a different port
    

我正在使用 xampp,在启动 xampp 时遇到错误,如何解决此错误。

最佳答案

解决方案:

在 XAMPP 控制面板上,停止 Apache 模块,单击“配置”按钮,然后选择 Apache (httpd.conf)。在文件中查找 (Ctrl+F) 80。将所有 80 替换为您喜欢的随机值(8080 看起来不错)并保存文件。现在单击“配置”按钮,然后选择 Apache (httpd-ssl.conf)。在文件中查找 (Ctrl+F) 443。将所有 443 替换为您喜欢的随机值(4433 看起来不错)并保存文件。再次启动 Apache 模块。 现在 APACHE 一定可以正常工作了:)

注意:

如果您想知道此错误的确切原因,请打开任务管理器并转到“详细信息”选项卡。查找 XAMPP 错误日志中提到的具有 PID 的进程。这里到底发生了什么,你的端口正忙于另一个由 PID(进程 ID)指示的进程。所以在解决方案中,我们所做的就是为APACHE分配另一个端口。

额外提示:

当您在浏览器地址栏上输入 localhost 时,它默认使用端口 80。但由于您更改了 Apache 模块的默认端口,因此请确保相应地调整本地主机的地址。例如,如果将端口 80 更改为端口 8080,则必须使用 http://localhost:8080/一直在浏览器上,这样您的浏览器就会知道 Apache 现在使用端口 8080,而不是默认端口。

看这并不难:)在你的主题中,你说“..数据库不工作”,但错误日志没有提到MySQL。如果你的MySQL模块也有同样的错误,你必须像上面那样做一个简单的端口配置。如果您遇到困难,可以从我的博客文章中找到步骤:http://ashenlive.blogspot.com/2016/08/web-programming-with-php.html

关于mysql - Apache 未启动如何解决此错误;本地主机数据库不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38921425/

相关文章:

mysql - MySQL TIMESTAMP 存储为 Unix 时间还是 ISO 8601?

java - Apache Common Math 的分数到双倍

node.js - Apache 不会将请求转发到 Nodejs 后端服务器

mysql - mysql 中数据类型 float 的默认大小 - phpmyadmin

java - 连接到在线 SQL 数据库

php - 在 IN 查询中使用 IN

mysql - 我的 sql 结果从行到列

php - 将 YouTube URL 替换为 MySQL PHPMyAdmin 中的嵌入代码

PHP:从 MySQL 创建数组以构建 HTML 日历

php - 无法在 PHP (Apache2) 中呈现动态创建的图像