如果你在本地虛擬機下跑Hyperf,windows下ip+端口,瀏覽器訪問不了,是因爲防火牆的問題,如果你防火牆用的是iptables,那就增加一個端口。
打開配置文件
# vi /etc/sysconfig/iptables
插入一行
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 9501 -j ACCEPT
重啓防火牆
# systemctl restart iptables.service
Ctrl+c斷掉hyperf服務
啓動服務
# php hyperf.php start
瀏覽器訪問