1.改為一下內容(有兩個部分)
<code class="hljs"><span class="hljs-tag"><Directory "E:/wamp/bin/apache/apache2.4.9/cgi-bin"> <span class="hljs-keyword">AllowOverride None <span class="hljs-keyword"><span class="hljs-common">Options None <span class="hljs-keyword">Require <span class="hljs-literal">all granted <span class="hljs-tag"></Directory> <span class="hljs-comment"># onlineoffline tag - don't remove <span class="hljs-keyword">Require <span class="hljs-literal">all granted <span class="hljs-keyword"><span class="hljs-common">allow from <span class="hljs-literal">all <span class="hljs-tag"></Directory></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
1.更改以下內容
<code class="hljs"><IfModule dir_module> DirectoryIndex index<span class="hljs-class">.php index<span class="hljs-class">.php3 index<span class="hljs-class">.html index<span class="hljs-class">.htm </IfModule><br></span></span></span></span></code>
2.如果localhost資料夾中沒有上面所包含的頁面,網址列輸入localhost將顯示localhost資料夾內的檔案
<code class="hljs"><span class="hljs-attribute">error_reporting =<span class="hljs-string"> E_ALL & ~E_NOTICE</span></span></code>
php.ini檔案裡的 date.timezone = prc(中國時區)
<code class="hljs"><span class="hljs-keyword">httpd.conf文件修改, <span class="hljs-keyword">AllowOverride <span class="hljs-literal">all <span class="hljs-keyword">Require <span class="hljs-literal">all granted <span class="hljs-keyword"><span class="hljs-common">allow from <span class="hljs-literal">all</span></span></span></span></span></span></span></span></code>
<code class="hljs"><span class="hljs-tag"><VirtualHost *:80> <span class="hljs-keyword"><span class="hljs-common">ServerName blog <span class="hljs-keyword"><span class="hljs-common">DocumentRoot <span class="hljs-string">"E:/blog" <span class="hljs-tag"><Directory "E:/blog"> <span class="hljs-keyword"><span class="hljs-common">Options Indexes FollowSymLinks <span class="hljs-keyword">AllowOverride <span class="hljs-literal">all <span class="hljs-keyword"><span class="hljs-common">Order Allow,Deny <span class="hljs-keyword"><span class="hljs-common">Allow from <span class="hljs-literal">all <span class="hljs-tag"></Directory> <span class="hljs-tag"></VirtualHost></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
<code class="hljs">文件位置:<span class="hljs-tag">C:\<span class="hljs-tag">Windows\<span class="hljs-tag">System32\<span class="hljs-tag">drivers\<span class="hljs-tag">etc 127<span class="hljs-class">.0<span class="hljs-class">.0<span class="hljs-class">.1 blog</span></span></span></span></span></span></span></span></code>
- 注意:
1. Options Indexes FollowSymLinks 如果沒有,則禁止 Apache 顯示目錄結構。使用者就不會看到該目錄下的檔案和子目錄清單了。
2. 第一次輸入第二站點時,需要在地址前面帶上http://(不知道為什麼)