php 在windows下配置虛擬目錄的方法,php虛擬目錄_PHP教程

來源:互聯網
上載者:User

php 在windows下配置虛擬目錄的方法,php虛擬目錄


1.先找到apache的設定檔 httpd.conf 找如如下代碼:

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

把# Include conf/extra/httpd-vhosts.conf 去掉#號,如下:

Include conf/extra/httpd-vhosts.conf

儲存。

2.開啟 Apache 的 conf 目錄下的 extra 檔案夾下的 httpd-vhosts.conf 檔案,用記事本開啟,在末尾加入以下代碼:

 1  2 ServerName www.mydemo.com 3 DocumentRoot "D:/mydemo" 4  5 Options FollowSymLinks IncludesNOEXEC Indexes 6 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml 7 AllowOverride Options FileInfo 8 Order Deny,Allow 9 Allow from all10 11 

3.再到C:->Windows->System32->drivers->etc目錄,開啟hosts檔案。
在末尾添加如下代碼:

1 127.0.0.1 www.mydemo.com

然後再建立D:\mydemo目錄
再然後重啟一下apache伺服器。
在瀏覽器輸入www.mydemo.com看看

http://www.bkjia.com/PHPjc/1048750.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1048750.htmlTechArticlephp 在windows下配置虛擬目錄的方法,php虛擬目錄 1.先找到apache的設定檔 httpd.conf 找如如下代碼: # Virtual hosts #Include conf/extra/httpd-vhosts.co...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.