简体   繁体   English

共享主机上的laravel 4项目在浏览器中不显示任何内容

[英]laravel 4 project on shared host displays nothing in browser

I have a problem deploying Laravel 4 on shared hosting server. 我在共享主机服务器上部署Laravel 4时遇到问题。 Currently I have access to cpanel with PHP version is 5.3.28 ( with no ssh access ). 目前,我可以使用PHP版本为5.3.28的cpanel进行访问(没有ssh access)。 I created the laravel project on my localhost and it worked pretty well. 我在本地主机上创建了laravel项目,效果很好。 Then I uploaded all laravel project files to the server and I have changed url variable in app/config/app.php from http://localhost to the new address. 然后,我将所有laravel项目文件上传到服务器,并将app / config / app.php中的url变量从http://localhost更改为新地址。 But when I view my page, browser shows just a blank page. 但是,当我查看我的页面时,浏览器仅显示一个空白页面。

for testing that, I echoed somthing in index.php and it printed well. 为了进行测试,我在index.php中回显了一些东西,并且打印效果很好。 but when I echoed here: Route::get('/', function(){ echo "hello"; } ); 但是当我在这里回显时: Route::get('/', function(){ echo "hello"; } ); nothing appeared in the page. 页面上没有任何内容。

here is my .htacess file beside index.php in public folder: 这是我在公用文件夹中index.php旁边的.htacess文件:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Have you checked the permission of your app/storage folder? 您是否检查了您的app / storage文件夹的权限?

You need to make it writable by the web server. 您需要使其可被Web服务器写入。

For example, on my mac, my web user is _www. 例如,在我的Mac上,我的Web用户是_www。 So you can use following command to make it work. 因此,您可以使用以下命令使其工作。

sudo chown -R _www LARAVEL_PROJECT/app/storage

or 要么

sudo chown -R a+w LARAVEL_PROJECT/app/storage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM