Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何让mamp使用本地主机套接字而不是0.0.0.0_Php_Mysql_Apache_Sockets - Fatal编程技术网

Php 如何让mamp使用本地主机套接字而不是0.0.0.0

Php 如何让mamp使用本地主机套接字而不是0.0.0.0,php,mysql,apache,sockets,Php,Mysql,Apache,Sockets,这是用于PC的MAMP的新安装 当我启动mamp时,它似乎是在0.0.0.0而不是localhost(127.0.0.1)上为apache和mysql设置套接字。因此,当尝试访问本地主机上的站点时,它无法连接。msql_error_日志条目显示mysql是这样的 150726 12:32:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 8889 150726 12:32:27 [Note] - '0.0.0.0' reso

这是用于PC的MAMP的新安装

当我启动mamp时,它似乎是在0.0.0.0而不是localhost(127.0.0.1)上为apache和mysql设置套接字。因此,当尝试访问本地主机上的站点时,它无法连接。msql_error_日志条目显示mysql是这样的

150726 12:32:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 8889
150726 12:32:27 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
150726 12:32:27 [Note] Server socket created on IP: '0.0.0.0'.
apache生成的错误表明,当使用localhost时,apache正在查找127.0.0.1中的文件:

http://localhost:8888/MAMP/htdocs
[Sun Jul 26 11:44:58 2015] [error] [client 127.0.0.1] File does not exist: C:/MAMP/htdocs/favicon.ico
[Sun Jul 26 11:44:58 2015] [error] [client 127.0.0.1] File does not exist: C:/MAMP/htdocs/favicon.ico
[Sun Jul 26 11:44:59 2015] [error] [client 127.0.0.1] File does not exist: C:/MAMP/htdocs/favicon.ico
[Sun Jul 26 11:44:59 2015] [error] [client 127.0.0.1] File does not exist: C:/MAMP/htdocs/favicon.ico
[Sun Jul 26 11:45:31 2015] [error] [client 127.0.0.1] File does not exist: C:/MAMP/htdocs/docs-assets, referer: 
我使用的是默认端口8888和8889,netstat-a显示使用这些端口的套接字位于0.0.0.0上

当我在浏览器上打开MAMP起始页(localhost:8888/MAMP/)时,它打开得很好,但是当我尝试连接到localhost:8888/MAMP/htdocs/上的站点时,我得到404错误


有人见过这个问题或知道解决方案吗?

当netstat显示一个服务器正在0.0.0.0上侦听时,这意味着它正在该端口上侦听所有IP地址。在本例中,它同时在127.0.0.1和计算机的IP地址(可能由DHCP分配)上侦听。当浏览器点击
http://localhost:8888/
?这是与文件系统中的目录“C:\MAMP\htdocs\”对应的URL。感谢您回答我的问题。当我浏览到时,会收到数据库错误消息:“建立数据库连接时出错”。