我已经将 public 文件夹中的文件上传到 public_html,将其他文件上传到 laravel。
我也改变了index.php。
但我什么也没得到......
[
我明白了...
有人可以帮助我吗?
谢谢
编辑:
这是我的索引文件,我认为这很好
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <[email protected]>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/../laravel/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
EDIT:
Now i have this locally in XAMPP
这个问题很老了,但其他人可能会发现这个答案很有用。基本上,您要做的就是配置应用程序以使其在新环境中正常工作。
Go to 000webhost cPanel > 设置 > 常规 > 重置网站。您必须确保您的网站中不存在其他内容,以防止干扰。
以 ZIP 格式存档整个 Laravel 项目。
将存档上传到 000webhost 站点即可/public_html
using 文件管理器.
移动与以下级别相同的所有文件/文件夹package.json
to /
Delete /public_html
。你将不再需要它了。
Rename /public
to /public_html
-
Go to /app/Providers/AppServiceProvider.php
at register()
方法并在其中添加以下代码:
$this -> app -> bind('path.public', function()
{
return base_path('public_html');
});
Open /.env
. Copy APP_KEY
value without base64:
-
Go to /config/app.php
, find 'key
' 并将该行替换为以下代码:
'key' => env('APP_KEY', base64_decode('%YOUR_COPIED_APPKEY%'));
如果您的项目已连接到数据库,请从以下位置更新数据库凭据/config/database.php
。查找mysql
正确引导并更新数据库、用户名、密码。
...这应该可以解决问题。如果您还有其他问题,这里已经编写了有关整个过程的教程:https://www.000webhost.com/forum/t/deploy-laravel-project-into-000webhost-site/127323/
希望这可以帮助 :)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)