Inhaltsverzeichnis
wampserver改变默认网站目录的办法,wampserver目录
Heim php教程 php手册 wampserver改变默认网站目录的办法,wampserver目录

wampserver改变默认网站目录的办法,wampserver目录

Jun 13, 2016 am 08:56 AM

wampserver改变默认网站目录的办法,wampserver目录

开发过php项目的都知道,大多数都会用到wampserver,接下来小编为大家分享下wampserver改变默认网站目录的方法。

需要修改的文件有以下三个:

apache2的配置文件 httpd.conf 和 Wampserver的 配置文件wampmanager.ini和wampmanager.tpl

其中httpd.conf 可以找到安装目录:下 bin\apache\apache2.x.xx\conf\httpd.conf 或者直接在wamp软件里面点击

打开配置文件后更改两处修改成指定的那个目录就可以了

这样配置文件中的目录已经更改了 但是这样还不行因为Wampserver是集成安装所以在Wampserver的配置文件中也有配置文件要修改

在Wampserver安装的目录下找到

wampmanager.ini

wampmanager.tpl

打开找到

wampmanager.ini中:

Type: item; Caption: "www directory"; Action: shellexecute; FileName: "F:\www"; Glyph: 2wampmanager.tpl中:Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "F:\www"; Glyph: 2

其中F:\www 是我指定的我的目录 你可以自己制定自己的 修改成你自己的就可以了

然后重启Wampserver就ok了

最后还有一点如果用原来的那个index.php会报错

原因是这个php中的引用的Wampserver配置文件文件是相对路径

所以 如果还要用原来的那么就改成你相应的那个绝对路径 或者不用这个

下面在借助一个示例给大家文字说明一下

假设如下:
Wamp版本:2.1
WAMP2.0安装目录:C:/
www目录:C:/wamp/www/
变更目录:E:/phproot/ 


一 主要过程:


(1)修改 C:\wamp\bin\apache\Apache2.2.17\conf \httpd.conf(实现更改默认网站路径,即将Http://localhost定向到自己的默认目录:E:/phproot/)
 
(2)拷贝并修改index.php(使新默认网站路径中的index.php可以正常显示,如果不需要Index.php可以略过此步)
 
(3)修改C:\wamp\wampmanager.ini和C:\wamp\wampmanager.tpl(改菜单中的“www 目录”指向)
 
二 具体修改方法全过程:
 
 第一步:修改C:\wamp\bin\apache\Apache2.2.17\conf \httpd.conf
 
查找: DocumentRoot "c:/wamp/www/"
 
修改: DocumentRoot "e:/phproot/"
 
查找:
 
修改:
 
 第二步:拷贝并修改index.php
 
(1)拷贝:
 
将C:/wamp/www/拷贝至e:/phproot
 
(2)查找:
 
//chemin jusqu'au fichier de conf de WampServer
 
$wampConfFile = '../wampmanager.conf';
 
//chemin jusqu'aux fichiers alias
 
$aliasDir = '../alias/';
 
(3)修改:
 
//chemin jusqu'au fichier de conf de WampServer
 
$wampConfFile = 'c:/wamp/wampmanager.conf';
 
        //chemin jusqu'aux fichiers alias
 
$aliasDir = 'c:/wamp/alias/';
 
 第三步:修改wampmanager.ini和wampmanager.tpl
 
1 修改C:\wamp\wampmanager.ini:
 
(1)打开:C:\wamp\wampmanager.ini
 
(2)查找:Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "c:/wamp/www/"; Glyph: 2
 
(3)修改:Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "e:/phproot/"; Glyph: 2
 
2 修改C:\wamp\wampmanager.tpl:
 
(1)打开:C:\wamp\wampmanager.tpl
 
(2)查找:Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwdir}"; Glyph: 2
 
(3)修改:Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "e:/phproot"; Glyph: 2
 
完成所有步骤,保存文件,至此修改成功。

以上通过图片介绍加文字说明的方式总结了wampserver改变默认网站目录的方法,希望大家喜欢。

Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
4 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
4 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. So reparieren Sie Audio, wenn Sie niemanden hören können
1 Monate vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat -Befehle und wie man sie benutzt
1 Monate vor By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)