php問題wampserver 區域網路無法訪問
今天測試了一個PHP的網頁, 出本機外區域網路其他機器無法訪問
經查詢得到問題解決辦法:
原文連結地址:http://www.nnbbxx.net/post-1426.html
wampserver2.5最新版本Apache : 2.4.9MySQL : 5.6.17PHP : 5.5.12PHPMyAdmin : 4.1.14當你安裝好之後開啟httpd.conf看到的原始配置是下面這樣的。原本的這種配置智能本機訪問,其他人不能訪問。看見預設的配置你會發現出現了兩個相同的。我感覺是相同的。而且2.5最新版本的httpd.conf檔案預設用記事本開啟是沒有換行的。坑爹但是你如果使用notepad++ 或者 sublime2或3開啟就可以看見換行了## DocumentR.........#此處省略N行注釋#..............and aliases may be used to point to other locations.#DocumentRoot "D:/wamp/www/"## Each directory.........#此處省略N行注釋#..............its subdirectories). ## First, we configure the "default" to be a very restrictive set of # features. # Require all denied## Note that fro.........#此處省略N行注釋#..............expect, make sure that you have specifically enabled it# below.# # # Possible values for the Options directive are "None", "All", #此處省略N行注釋 # for more information. # Options Indexes FollowSymLinks # # AllowOverride......... #此處省略N行注釋 #..............ileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff from this server. ## onlineoffline tag - don't remove Require local上面也說了上面的配置不行。下面就說說怎麼改。上面我已經粘出來了2處地方,那我們要修改也就是這兩處。看下面的配置方法。DocumentRoot "D:/wamp/www/" AllowOverride none order deny,allow allow from all# Require all denied Options Indexes FollowSymLinks AllowOverride all order deny,allow allow from all# Require local上面的代碼看完之後是不是明白了。兩處地方都要修改其他人才能訪問,只修改一處地方那別人訪問的時候就會出現403的現象。上面的代碼就是我們把Require local注釋掉,在添加AllowOverride all、order deny,allow、allow from all這三行,其他人就可以訪問了。