简体   繁体   English

macOS Sierra:Localhost无法连接

[英]macOS Sierra: Localhost will not connect

I just updated to Sierra from El Capitan. 我刚刚从El Capitan更新到Sierra。 When I went to continue my work on my localhost, which happens to be on my Mac, it stopped working. 当我继续我的本地主机上的工作时,它正好在我的Mac上,它停止了工作。 When I go to http://localhost/ 1st it says "It works", when I reload the page, it says "This site can't be reached", the same when I go to localhost/~matthew . 当我去http://localhost/ 1st它说“它工作”时,当我重新加载页面时,它说“无法访问此站点”,当我转到localhost/~matthew It does not list all the files and folders like it should. 它没有列出它应该的所有文件和文件夹。 Does anybody know why or have had a similar problem? 有人知道为什么或有过类似的问题吗? Any way to fix it? 有什么办法解决吗? I've checked Terminal and localhost is in fact running. 我检查过终端,localhost实际上正在运行。

I've already tried using localhost/~matthew/ , http://localhost/~matthew/ and [actual ip address]/~matthew/ . 我已经尝试过使用localhost/~matthew/http://localhost/~matthew/[actual ip address]/~matthew/ http://localhost/~matthew/ [actual ip address]/~matthew/ None of these work. 这些都不起作用。 The server is apache. 服务器是apache。 The Sites folder is already in place under Users/Matthew/ . Sites Users/Matthew/下已存在Sites文件夹。

macOS Sierra上的Localhost无法正常工作

If you uncommened loading php5_module in the /etc/apache2/httpd.conf, DO NOT COMMENT OUT. 如果你在/etc/apache2/httpd.conf中没有注意到加载php5_module,请不要注释掉。 Make sure this line commented (which means, # has to be prefixed) #LoadModule php5_module libexec/apache2/libphp5.so Also, when you change httpd.conf file, make sure to execute sudo apachectl restart 确保此行已注释(这意味着,#必须加前缀) #LoadModule php5_module libexec/apache2/libphp5.so此外,当您更改httpd.conf文件时,请确保执行sudo apachectl restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM