V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kisshere
V2EX  ›  程序员

AMH 配置的 lnmp 环境架设虚拟机,服务器上能用 127.0.0.1 来访问本地网站吗?

  •  
  •   kisshere · Jan 30, 2015 · 2748 views
    This topic created in 4117 days ago, the information mentioned may be changed or developed.
    AMH配置的lnmp环境架设虚拟机,假设网址为www.example.com,现在我要用这台虚拟机上www.example.com/a.php自己来抓取自己的www.example.com/target.php这个文件,如果按常理只需在a.php中写:echo file_get_contents('www.example.com/target.php'),但这样是否会影响速度?我能否写成:echo file_get_contents('127.0.0.1/target.php'),试了下不行,求问V神们有没有好的解决办法?
    3 replies    2015-01-30 20:37:21 +08:00
    zxy
        1
    zxy  
       Jan 30, 2015   ❤️ 1
    hosts
    127.0.0.1 www.example.com
    loveyu
        2
    loveyu  
       Jan 30, 2015   ❤️ 1
    服务器没配DNS吧
    webjin
        3
    webjin  
       Jan 30, 2015   ❤️ 1
    vi /etc/hosts
    xxx.xxx.xxx domain.xxx
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3009 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 07:18 · PVG 15:18 · LAX 00:18 · JFK 03:18
    ♥ Do have faith in what you're doing.