在托管服务器上部署 Laravel 4
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17152953/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Deploying Laravel 4 on hosting server
提问by Goran Backlund
I have a problem deploying Laravel 4 on hosting server (hostgator). I have uploaded all files to the server. Current PHP version is 5.3.24 and I have followed all the instructions on four.laravel.com/docs/installation.
我在托管服务器 (hostgator) 上部署 Laravel 4 时遇到问题。我已将所有文件上传到服务器。当前的 PHP 版本是 5.3.24,我遵循了four.laravel.com/docs/installation 上的所有说明。
I get following error:
我收到以下错误:
Fatal error: Call to a member function run() on a non-object in /home3/varoid/public_html/index.php on line 51
回答by DerLola
If you look at the index.php in your public_html folder, you'll see it calls $app->run(). Since run isn't defined, $app is probably not available. On line 35 the $app is set like this:
如果您查看 public_html 文件夹中的 index.php,您会看到它调用 $app->run()。由于未定义 run, $app 可能不可用。在第 35 行,$app 设置如下:
$app = require_once __DIR__.'/../bootstrap/start.php';
It doesn't work for you, so this means the start.php could not be found. Maybe you placed it elsewhere than the default path? In case you didn't know __DIR__ means, the current dir (public_html). Just make sure the file exists and try again!
它对您不起作用,因此这意味着无法找到 start.php。也许你把它放在默认路径之外的其他地方?如果您不知道 __DIR__ 表示当前目录 (public_html)。只需确保该文件存在,然后再试一次!