要修改 phpstudy 的 80 端口,需要編輯 hosts 文件添加 phpstudy 網(wǎng)站 ip 地址和域名,然后重啟 apache http server 服務(wù)。通過訪問 http://website.example.com 驗(yàn)證更改是否成功。
如何修改 PHPstudy 的 80 端口
回答:
要修改 PHPstudy 的 80 端口,需要編輯配置文件并重啟服務(wù)。
步驟:
找到配置文件:
Windows:C:\Windows\System32\drivers\etc\hosts
macOS:/etc/hosts
編輯配置文件:
打開 hosts 文件。
找到類似于以下行的行:127.0.0.1
.
在該行后添加 PHPstudy 網(wǎng)站的 IP 地址和域名,例如:127.0.0.1 website.example.com
重啟 PHPstudy 服務(wù):
Windows:打開控制面板,轉(zhuǎn)到“管理工具”,然后單擊“服務(wù)”。找到“Apache HTTP Server”服務(wù),右鍵單擊并選擇“重新啟動(dòng)”。
macOS:打開終端,輸入以下命令:sudo apachectl restart
驗(yàn)證更改:
在瀏覽器中打開 http://website.example.com
。如果您能看到 PHPstudy 的默認(rèn)頁面,則說明修改已成功。