从 ubuntu 上的 laravel 开始 [英] Starting with laravel on ubuntu

查看:21
本文介绍了从 ubuntu 上的 laravel 开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 laravel 作为 PHP 框架,我已经将 laravel zip 解压缩到 ~/opt/xampp/htdocs/laravel 但是当我转到 localhost/laravel 时code> 或 localhost/laravel 我收到一条 403 错误消息:

I'm trying laravel as a PHP framework, I have already extracted the laravel zip into ~/opt/xampp/htdocs/laravel but when I go to localhost/laravel or localhost/laravel I get a 403 error message saying:

禁止访问!

您无权访问所请求的对象.它要么受读保护,要么无法被服务器读取.

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

我在某处读到我需要编辑 laravel 内的 storage 文件夹,以便它可以读写,所以我 chmod -R 766 laravel/storage 但仍然没有幸运的是,我是从 Ubuntu 12.04 开始的,有人遇到过吗?

编辑
我有 chmod -R 0+w laravel/storage 现在当我去 localhost/laravel 时,我得到了一些文件的索引,但是当我去 localhost/laravel/public/ 仍然得到 403 错误,而不是预期的结果

编辑 2
我已经设置了 chmod -R 765 laravel/public,现在当我到达 localhost/laravel/public 时,我收到了这条消息,这让我相信我越来越近了:

I read somewhere that I need to edit the storage folder inside of laravel so it can be readable and writable so I chmod -R 766 laravel/storage but still no luck, I'm doing this from Ubuntu 12.04 have anyone encountered this ?

EDIT
I have chmod -R 0+w laravel/storage and now when i go to localhost/laravel i get an index of some files in there, but when i go to localhost/laravel/public/ still get the 403 error, instead of the expected result

EDIT 2
I have set chmod -R 765 laravel/public and now when i get to localhost/laravel/public i get this message which leads me to believe i'm getting closer:

警告:需要(/opt/lampp/htdocs/learning-laravel/laravel/laravel.php):无法打开流:权限被拒绝在/opt/lampp/htdocs/learning-laravel/public/index.php第 34 行

Warning: require(/opt/lampp/htdocs/learning-laravel/laravel/laravel.php): failed to open stream: Permission denied in /opt/lampp/htdocs/learning-laravel/public/index.php on line 34

致命错误:require(): 在/opt 中打开所需的 '/opt/lampp/htdocs/learning-laravel/laravel/laravel.php' (include_path='.:/opt/lampp/lib/php') 失败/lampp/htdocs/learning-laravel/public/index.php 第 34 行

Fatal error: require(): Failed opening required '/opt/lampp/htdocs/learning-laravel/laravel/laravel.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/learning-laravel/public/index.php on line 34

推荐答案

最终更新
我终于解决了,发生的事情是 laravel 文件夹被读保护,我要做的是设置 chmod 755 -R laravel 然后 chmod -R o+w 存储 瞧,我已经启动并运行了 laravel,感谢所有贡献者.

Final Update
I finally solved it, what happened was that the laravel folder was read protected, what i had to do was to set chmod 755 -R laravel and then chmod -R o+w storage and voila i had laravel up and running, thanks to everybody that contributed.

这篇关于从 ubuntu 上的 laravel 开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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