无法使Laravel 4在本地主机上工作 [英] Can't make Laravel 4 to work on localhost
问题描述
在阅读了Laravel4 beta发布公告后,我第一次尝试使用Laravel.
I'm trying Laravel for the first time after reading an announcement of the Laravel4 beta releasing.
我遵循了这些步骤,我安装了composer和laravel及其所需的所有依赖项.我将laravel放在我的~/public_html
目录中-就像我以前使用Codeigniter一样,但是我认为这里有些问题.
I followed these steps I installed composer and laravel with all the dependencies it needed. I put the laravel inside my ~/public_html
directory - as I'm used to do it with Codeigniter, but I think something's wrong here.
如果我将浏览器指向http://localhost/~carlo/laravel-develop/
,它将仅显示目录的内容.
If I point to the browser to http://localhost/~carlo/laravel-develop/
, it just displays the content of the directory.
然后,在文件系统上,当我有一个laravel-develop/public
文件夹时,它没有出现在浏览器中.
Then, while on the filesystem I had a laravel-develop/public
folder, it didn't appear on the browser.
我发现可以这样更改.htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
当我尝试访问公用文件夹时导致错误. 错误:
resulted in an error when I try to access the public folder. The error:
ErrorException:警告:file_put_contents(/home/carlo/public_html/laravel-develop/app/config/../storage/meta/services.json):无法打开流:/home/carlo/public_html中的权限被拒绝/laravel-develop/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php第77行
ErrorException: Warning: file_put_contents(/home/carlo/public_html/laravel-develop/app/config/../storage/meta/services.json): failed to open stream: Permission denied in /home/carlo/public_html/laravel-develop/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php line 77
另一个:
/home/carlo/public_html/laravel-develop/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php第77行
/home/carlo/public_html/laravel-develop/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php line 77
然后是一长串错误.最后一个是:
then a long list of errors. The last one is:
require_once('/home/carlo/public_html/laravel-develop/start.php')在/home/carlo/public_html/laravel-develop/public/index.php第53行
require_once('/home/carlo/public_html/laravel-develop/start.php') in /home/carlo/public_html/laravel-develop/public/index.php line 53
推荐答案
尝试使用终端更改storage
文件夹的文件夹权限:
Try to change the folder permissions for the storage
folder using the terminal:
chmod -R 777 storage
有关此问题的更多信息,请此处.
More info on this matter can be found here.
这篇关于无法使Laravel 4在本地主机上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!