大学网 > php中文网 > 运维phpstudy怎么修改80端口正文

phpstudy怎么修改80端口

中国大学网 2024-10-17
要修改 phpstudy 的 80 端口,需要编辑 hosts 文件添加 phpstudy 网站 ip 地址和域名,然后重启 Apache http server 服务。通过访问 http://website.example.com 验证更改是否成功。

phpstudy怎么修改80端口

如何修改 PHPstudy 的 80 端口

回答:

要修改 PHPstudy 的 80 端口,需要编辑配置文件并重启服务。

步骤:

立即学习“PHP免费学习笔记(深入)”;

  1. 找到配置文件:

    • Windows:C:\Windows\System32\drivers\etc\hosts
    • macOS:/etc/hosts
  2. 编辑配置文件:

    • 打开 hosts 文件。
    • 找到类似于以下行的行:127.0.0.1.
    • 在该行后添加 PHPstudy 网站的 IP 地址和域名,例如:127.0.0.1 website.example.com
  3. 重启 PHPstudy 服务:

    • Windows:打开控制面板,转到“管理工具”,然后单击“服务”。找到“Apache HTTP Server”服务,右键单击并选择“重新启动”。
    • macOS:打开终端,输入以下命令:sudo apachectl restart
  4. 验证更改:

    • 在浏览器中打开 http://website.example.com。如果您能看到 PHPstudy 的默认页面,则说明修改已成功。

以上就是phpstudy怎么修改80端口的详细内容,更多请关注中国大学网其它相关文章!