2015-04-02 95 views
1

當我從另一個本地網站(site2.local)調用它時,我得到一個Curl error 7: Failed to connect to site1.local port 8000: Connection refused。這兩個網站都運行在同一個Vagrant框中。使用guzzle流浪流浪捲毛錯誤7

當我將url替換爲外部網站(例如google.com)的url時,連接時沒有問題。

爲什麼流浪者會拒絕他自己的電話? 我搜索了這個問題,但找不到解決方法。

有沒有辦法使用curl在同一臺服務器上調用另一個站點?

編輯:

Vagrantfile:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    Homestead.configure(config, YAML::load(File.read(path + '/Homestead.yaml'))) 
end 

Homestead.yaml

--- 
ip: "192.168.10.10" 
memory: 2048 
cpus: 1 

authorize: C:/Users/Robert/.ssh/id_rsa.pub 

keys: 
    - C:/Users/Robert/.ssh/id_rsa 

folders: 
    - map: A:/homestead/projects 
     to: /home/vagrant/projects 

sites: 
    - map: site1.local 
     to: /home/vagrant/projects/work/work-site-1/public 
    - map: site2.local 
     to: /home/vagrant/projects/work/work-site-2/public 
+0

編輯vagrantfile和homestead.yaml的問題 – 2015-04-02 16:06:49

回答

2

,當你想從你的本地箱訪問遊民站點的80008443端口僅用於(主機)。如果要訪問vagrant(訪客機器)內的站點,應使用標準HTTP端口(80),因爲不需要任何映射。

我敢打賭,這是問題。