dongzao4503 2017-03-22 07:26
浏览 64

LARAVEL - 将我的laravel项目放在000webhost上

i already upload files in the public folder to public_html, and others to laravel.

i changed index.php too.

but i get nothing ....

[What s[][1][1]

enter image description here

enter image description here

I get this... Some one can help me? Thanks

EDIT: This is my index file, i think thats is good

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

/*
|--------------------------------------------------------------------------
| 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 enter image description here

  • 写回答

2条回答 默认 最新

  • dqybjj3497 2018-06-18 21:08
    关注

    The question is quite old however others may find this answer useful. Basically what you have to do is to configure the App to work properly in the new environment.

    1. Go to 000webhost cPanel > Settings > General > Reset website. You must make sure no other content is present in your site to prevent interference.

    2. Archive your entire Laravel Project in ZIP format.

    3. Upload the archive to 000webhost site to /public_html using File Manager.

    4. Move all files/folders which are on the same level with package.json to /

    5. Delete /public_html. You won't need it anymore.

    6. Rename /public to /public_html

    7. Go to /app/Providers/AppServiceProvider.php at register() method and append the following code inside it:

      $this -> app -> bind('path.public', function() { return base_path('public_html'); });

    8. Open /.env. Copy APP_KEY value without base64:

    9. Go to /config/app.php, find 'key' and replace the line with the following code:

      'key' => env('APP_KEY', base64_decode('%YOUR_COPIED_APPKEY%'));

    10. If you have your project connected to a database, update the database credentials from /config/database.php. Lookup for mysql vector and update the database, username, password properly.

    ...And this should do the trick. If you have further questions, a tutorial has been written about the entire procedure here: https://www.000webhost.com/forum/t/deploy-laravel-project-into-000webhost-site/127323/

    Hope this helps :)

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大