apache mySQL和XAMPP的端口冲突

jtjikinw  于 2022-11-16  发布在  Apache
关注(0)|答案(4)|浏览(190)

我使用XAMPP/Apache已经有一段时间了,最近决定安装MySQL。然而,它们似乎是冲突的。MySQL似乎是优先的,它工作正常,然而,XAMPP/Apache是给我这个错误消息时,试图启动Apache:

03:07:32 AM  [Apache]   Attempting to start Apache app...
03:07:33 AM  [Apache]   Status change detected: running
03:07:33 AM  [Apache]   Status change detected: stopped
03:07:33 AM  [Apache]   Error: Apache shutdown unexpectedly.
03:07:33 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
03:07:33 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
03:07:33 AM  [Apache]   Press the Logs button to view error logs and check
03:07:33 AM  [Apache]   the Windows Event Viewer for more clues
03:07:33 AM  [Apache]   If you need more help, copy and post this
03:07:33 AM  [Apache]   entire log window on the forums

我试着按照下面的说明操作:http://www.complete-concrete-concise.com/web-tools/how-to-change-the-apache-port-in-xampp
我尝试过更改文档:在xampp/apache/conf文件中找到httpd.conf文件
将“Listen 80”更改为各种内容,重新启动应用程序后,我出现了同样的错误信息。
我非常感谢在这件事上的任何帮助。我不喜欢删除mySQL只是为了使用XAMPP,但如果没有办法让它们同时运行,我会删除。
先谢谢你。
编辑:
我认为它与MySQL冲突的原因是:

03:26:51 AM  [mysql]    Problem detected!
03:26:51 AM  [mysql]    Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56"!
03:26:51 AM  [mysql]    MySQL WILL NOT start without the configured ports free!
03:26:51 AM  [mysql]    You need to uninstall/disable/reconfigure the blocking application
03:26:51 AM  [mysql]    or reconfigure MySQL and the Control Panel to listen on a different port

我在暂时禁用mySQL以使用XAMPP/Apache时遇到了一些困难。有没有办法更改端口以便它们可以共存?
编辑2:
已尝试遵循此处的指示:http://silentlyrun.blogspot.com.au/2013/02/how-to-change-apache-n-mysql-port-for.html
我在以下情况下遇到这些错误消息:

09:13:22 AM  [main]     Initializing Modules
09:13:22 AM  [Apache]   Problem detected!
09:13:22 AM  [Apache]   Port 80 in use by "Unable to open process" with PID 4084!
09:13:22 AM  [Apache]   Apache WILL NOT start without the configured ports free!
09:13:22 AM  [Apache]   You need to uninstall/disable/reconfigure the blocking application
09:13:22 AM  [Apache]   or reconfigure Apache and the Control Panel to listen on a different port
09:13:22 AM  [Apache]   Problem detected!
09:13:22 AM  [Apache]   Port 443 in use by "Unable to open process" with PID 4084!
09:13:22 AM  [Apache]   Apache WILL NOT start without the configured ports free!
09:13:22 AM  [Apache]   You need to uninstall/disable/reconfigure the blocking application
09:13:22 AM  [Apache]   or reconfigure Apache and the Control Panel to listen on a different port

有了这些说明,新的端口应该是一样的吗?我假设是这样的,因为它们最初都是80。

4. Search the string "Listen" in the file.
5. Replace port number 80 to any other unused port number.
6. Search for "ServerName" in the file.
7. Replace port number 80 to any other unused port number in the ServerName.

编辑3:
由于我不知道的原因,XAMPP/MySQL在从上面的silentlyrun.blogspot链接重新安装和更改端口后没有问题。但是XAMPP/Apache仍然出现问题:

09:32:14 AM  [Apache]   Error: Apache shutdown unexpectedly.
09:32:14 AM  [Apache]   This may be due to a blocked port, missing dependencies, 
09:32:14 AM  [Apache]   improper privileges, a crash, or a shutdown by another method.
09:32:14 AM  [Apache]   Press the Logs button to view error logs and check
09:32:14 AM  [Apache]   the Windows Event Viewer for more clues
09:32:14 AM  [Apache]   If you need more help, copy and post this
09:32:14 AM  [Apache]   entire log window on the forums
lxkprmvk

lxkprmvk1#

要解决MySQL端口和服务冲突时,已经有另一个MySQL服务器正在运行,您需要按照以下步骤:-
1.关闭XAMPP服务器
1.打开文件C:是默认的XAMPP安装)
1.将端口号3306替换为3307

# password       = your_password  
port            = 3307
socket         = "C:/xampp/mysql/mysql.sock"

\# The MySQL server
[mysqld]
port= 3307

1.保存文件并打开XAMPP控制面板(以管理员身份运行,否则将不允许进行以下更改)
1.在XAMPP控制面板中,单击配置服务和端口设置
1.后藤MySQL选项卡
1.将服务名称mysql更改为mysqlxampp,将主端口3306更改为3307
1.单击保存然后单击保存并关闭XAMPP
1.再次运行XAMPP,即可启动MySQL服务器
您还可能遇到phpMyAdmin问题
您可以为其添加行

$cfg['Servers'][$i]['port'] = '3307';

在phpMyAdmin根目录下的config.inc.php文件中。

s4chpxco

s4chpxco2#

如果您单独安装了MySQL,同时运行了XAMPP的MySQL,则会遇到此问题。冲突是针对端口3306,而不是端口80。我建议您遵循以下指南:
http://silentlyrun.blogspot.com.au/2013/02/how-to-change-apache-n-mysql-port-for.html
当我单独安装MySQL并将其作为XAMPP的一部分时,这对我很有效。

qfe3c7zg

qfe3c7zg3#

重新启动你的机器,然后使用命令行netstat。它会告诉你哪个应用程序打开了端口。

ecfdbz9o

ecfdbz9o4#

我回答这个问题的人谁是发现这个问题,并希望一个更好和快速的解决方案。
打开任务管理器-〉搜索'mysqld' -〉结束任务

**提示:**键入“m”可加快搜索速度.

我的猜测是,当您关闭xampp而不停止正在运行的服务器时,xampp不会自动停止这些服务器,它们仍然在后台运行。
但是当你再次打开xampp时,它无法识别这些正在进行的进程,并认为它们阻塞了端口。

相关问题