我是Laravel 5的新手并且已经意识到很多已经改变,我对Laravel 4更熟悉。我只是尝试将我的网站上传到实时VPS,我设法更改了index.php
中的网址server.php
但我一直收到这些错误:
这让我相信还有其他我应该改变的东西我没有,因为这些文件确实在那里,我的应用程序在我的本地主机上工作得很好。
除了我的主页外,当我点击他们的链接时,其他页面都说没有找到。
这是我的文档结构:
的index.php
<?php
require __DIR__.'/../*********/bootstrap/autoload.php';
$app = require_once __DIR__.'/../*********/bootstrap/app.php';
$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
server.php
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' and file_exists(__DIR__.'/../public_html'.$uri))
{
return false;
}
require_once __DIR__.'/../public_html/index.php';
答案 0 :(得分:2)
在接下来的步骤中,必须遵循将本地移动到Laravel中的实时服务器。
将所有公用文件夹数据移动到根目录
在index.php中将路径更改为 需要 DIR 。'/ .. / bootstrap / autoload.php';要求 DIR 。'/ bootstrap / autoload.php';
和
$ app = require_once DIR 。'/ .. / bootstrap / app.php';至$ app = require_once DIR 。'/ bootstrap / app.php';
并将文件权限设置为744
在.htaccess文件中,在RewriteEngine On后添加以下代码。
RewriteBase /
更改.env文件中的参数。