安装在线调试工具
twitch@ServerTwo:/var/www/xdh$ composer require barryvdh/laravel-debugbar
安装好后,再提交一次仓库!
twitch@ServerTwo:/var/www/xdh$ git status
root@ServerTwo:/var/www/xdh# git add .
root@ServerTwo:/var/www/xdh# git status
root@ServerTwo:/var/www/xdh# git commit -m "debug init"
root@ServerTwo:/var/www/xdh# git status
创建一个新的分支
root@ServerTwo:/var/www/xdh# git checkout -b "testRoute"
切换到一个新分支 'testRoute'
root@ServerTwo:/var/www/xdh# git branch
master
* testRoute
创建一个分支后在当前的分支上(不是主分支),就可以放心大胆的编写代码了,提交也是提交到分支上,不会影响主分支
修改一段代码测试下!
root@ServerTwo:/var/www/xdh# cd app/ //应用目录
root@ServerTwo:/var/www/xdh/app# cd Http/ // 进入http 模块 传输层相关的类目录
root@ServerTwo:/var/www/xdh/app/Http# vim routes.php
修改路由,来测试下
Route::get('/', function () {
return view('welcome');
});
Route::get('/test', function () {
echo "test page!";
});
vim 快捷命令!
yy 3 复制3行
修改好后,访问下,可能会报权限不够的错误,需修改下权限,再次访问!
root@ServerTwo:/var/www/xdh# chmod -R 777 bootstrap/
test.png
看到上面的url 是不是很蛋疼!一点也不优雅!
优雅地址,重定向打开!
mods-enable 开启的模块
查看下apache 开启了那些模块,有 rewrite.load 重定向模块没
查看有那些模块,寻找rewrite!
root@ServerTwo:/etc/apache2# ls mods-available/
rewirte
加载重定向模块
root@ServerTwo:/etc/apache2# ln -s /etc/apache2/mods-available/rewrite.load ./mods-enabled/
load rewrite
模块加载进来后,重启下apache
service apache2 restart
访问没生效,模块加载进来了,肯定是权限没开启,所以还需要修改一下配置文件
apache_conf.png
把 箭头指向的 地方 None 修改为 All
再重启下
apachectl restart
扩展知识
**dd() 函数 **
- 全部格式化输出 相当于 var_dump()
- dd() 函数后面的程序终止程序运行 相当于 var_dump() 后面加了一个 exit