Ubuntu 下Laravel 路由失败原因分析

来源:互联网 发布:中国武术不堪一击知乎 编辑:程序博客网 时间:2024/06/09 05:37

今天搭建好Ubuntu服务器、配置Laravel,然后试着测试一个路由程序;

官方步骤:

To get started, let's create our first route. In Laravel, the simplest route is a route to a Closure. Pop open theapp/routes.php file and add the following route to the bottom of the file:

Route::get('users', function(){    return 'Users!';});

测试系统自带路由 "/"没有问题,在测试/users时缺提示 “Object not found” Error 404;

经过分析,是由于在httpd-xampp.conf配置文件夹权限时漏掉了AllowOverride All选项;

问题找到就好解决了。

sudo nano /opt/lamp/etc/extra/httpd-xampp.conf


在对应的alias <Directory></Directory>标签下添加AllowOverride All。

再次访问,正常,问题解决!

0 0