phpstudyÔõôÐÞ¸Ä80¶Ë¿Ú
ÒªÐÞ¸Ä phpstudy µÄ 80 ¶Ë¿Ú£¬ÐèÒª±à¼ hosts ÎļþÌí¼Ó phpstudy ÍøÕ¾ ip µØµãºÍÓòÃû£¬È»ºóÖØÆô apache http server ЧÀÍ¡£Í¨¹ý»á¼û http://website.example.com ÑéÖ¤¸ü¸ÄÊÇ·ñÀֳɡ£
ÔõÑùÐÞ¸Ä PHPstudy µÄ 80 ¶Ë¿Ú
»Ø¸²£º
ÒªÐÞ¸Ä PHPstudy µÄ 80 ¶Ë¿Ú£¬ÐèÒª±à¼ÉèÖÃÎļþ²¢ÖØÆôЧÀÍ¡£
°ì·¨£º
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
ÕÒµ½ÉèÖÃÎļþ£º
Windows£ºC:\Windows\System32\drivers\etc\hosts
macOS£º/etc/hosts
±à¼ÉèÖÃÎļþ£º
·¿ª hosts Îļþ¡£
ÕÒµ½ÀàËÆÓÚÒÔÏÂÐеÄÐУº127.0.0.1.
ÔÚ¸ÃÐкóÌí¼Ó PHPstudy ÍøÕ¾µÄ IP µØµãºÍÓòÃû£¬ÀýÈ磺127.0.0.1 website.example.com
ÖØÆô PHPstudy ЧÀÍ£º
Windows£º·¿ª¿ØÖÆÃæ°å£¬×ªµ½¡°ÖÎÀí¹¤¾ß¡±£¬È»ºóµ¥»÷¡°Ð§ÀÍ¡±¡£ÕÒµ½¡°Apache HTTP Server¡±Ð§ÀÍ£¬ÓÒ¼üµ¥»÷²¢Ñ¡Ôñ¡°ÖØÐÂÆô¶¯¡±¡£
macOS£º·¿ªÖնˣ¬ÊäÈëÒÔÏÂÏÂÁsudo apachectl restart
ÑéÖ¤¸ü¸Ä£º
ÔÚä¯ÀÀÆ÷Öз¿ª http://website.example.com¡£ÈôÊÇÄúÄÜ¿´µ½ PHPstudy µÄĬÈÏÒ³Ã棬Ôò˵Ã÷ÐÞ¸ÄÒÑÀֳɡ£
ÒÔÉϾÍÊÇphpstudyÔõôÐÞ¸Ä80¶Ë¿ÚµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡