如何在laravel中本地设置mydomain.com? [英] How to set mydomain.com locally in laravel?

查看:46
本文介绍了如何在laravel中本地设置mydomain.com?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是laravel的新手,并且我已经安装了laravel的新副本.我的项目根目录位于 E:/xampp/htdocs/myapp 中,我希望将其加载到浏览器中的myapp.com上吗?我正在为项目使用laravel 5.2和xampp.

I am new to laravel, and I have installed a fresh copy of laravel. My project root directory is located in E:/xampp/htdocs/myapp and I want this to load on myapp.com in browser how exactly to do this ? I am using laravel 5.2 and xampp for my project.

推荐答案

可以在xampp设置上启用虚拟主机.首先,您需要访问 E:\ xampp \ apache \ conf \ extra \ https-vhosts.conf 并进行一些编辑.在您喜欢的编辑器中编辑httpd-vhosts.conf文件,并在httpd-vhosts.conf文件的末尾添加以下代码.

It is possible with enabling virtual host on your xampp settings. First of all you need to visit E:\xampp\apache\conf\extra\https-vhosts.conf and make some edits. Edit httpd-vhosts.conf file in your favorite editor and add the below code at end of the httpd-vhosts.conf file.

<VirtualHost *:80>
    DocumentRoot "E:/xampp/htdocs/yourprojectfolder/public"
    ServerName yourdesirename.com
</VirtualHost>

此后,您需要以管理员身份打开记事本并编辑主机文件

After this you need open notepad as administrator and edit hosts file

(C:\ Windows \ System32 \ drivers \ etc \ hosts)

(C:\Windows\System32\drivers\etc\hosts)

注意::如果主机文件未显示在目标目录中,则需要将选择框更改为显示所有文件"

Note : If hosts file is not showing in the target directory you need to change the select box to 'Show All Files'

并在hosts文件的末尾添加 127.0.0.1 localhost yourdesirename.com ,一旦完成,请打开浏览器并输入 yourdesirename.com ,您的项目将开始跳舞在那里.

and add 127.0.0.1 localhost yourdesirename.com at the end of hosts file, once done now open your browser and type yourdesirename.com and your project will dance live there.

这篇关于如何在laravel中本地设置mydomain.com?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆