Laravel
composer create-project laravel/laravel demo --prefer-dist
開啟C:\xampp\apache\conf\httpd.conf
#LoadModule rewrite_module modules/mod_rewrite.so
// 註解取消
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
// 註解取消
<Directory />
AllowOverride all
Require all denied
</Directory>
// 確定為 AllowOverride all
C:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80> // port為80
##ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:/xampp/htdocs/Laravel_demo/demo/public"
// 創立的 demo 位址
ServerName demo
// 域名
##ServerAlias www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
C:\Windows\System32\drivers\etc\hosts
新增 127.0.0.1 demo
DocumentRoot "C:/xampp/htdocs/Laravel_demo/demo/"
將C:\xampp\htdocs\Laravel_demo\demo\server.php 改為 index.php
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up