Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/01/2021, 10:45
Avatar de Middrel
Middrel
 
Fecha de Ingreso: abril-2005
Mensajes: 835
Antigüedad: 19 años
Puntos: 27
Duda al subir Laravel a hosting

Hola, buenos días

Tengo una duda al subir un sitio hecho en Laravel 8, ya realicé las configuraciones necesarias pero cuando quiero ver el sitio me sale: 404 | Not found

Lo subí por medio de cPanel, tengo la carpeta laravel en la raíz de mi home y la carpeta public en public_html:

home/site
- laravel
- public_html -> index.html/static/...

en el archivo index.html ya configuré las rutas:

Código PHP:
if (file_exists(__DIR__.'/../laravel/storage/framework/maintenance.php')) {
    require 
__DIR__.'/../laravel/storage/framework/maintenance.php';
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__.'/../laravel/vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__.'/../laravel/bootstrap/app.php';

$kernel $app->make(Kernel::class);

$response tap($kernel->handle(
    
$request Request::capture()
))->
send();

$kernel->terminate($request$response); 
en el archivo AppServiceProvider.php

Código PHP:
class AppServiceProvider extends ServiceProvider
{
    
/**
     * Register any application services.
     *
     * @return void
     */
    
public function register()
    {
        
$this->app->bind('path.public',function(){
            return
'/home/site/public_html';
        });
    }

    
/**
     * Bootstrap any application services.
     *
     * @return void
     */
    
public function boot()
    {
        
//
    
}

ya modifiqué también el archivo .env:

Código PHP:
APP_NAME=Laravel
APP_ENV
=production
APP_KEY
=base64:7Ht+wWXADSNylOny6CY5nv1ydvsc/+egnuHTmM23GKg=
APP_DEBUG=false
APP_URL
=http://localhost 
y mis rutas:

Código PHP:
Route::get('/', function () {
    return 
view('welcome');
}); 
solo tienen una página por el momento, el home.

En el servidor tengo configurado con PHP 7.3, aunque ya probé con 7.2 y 7.4, además tengo las extensiones de PHP que requiere Laravel instaladas.

Ahora, estoy siguiendo un tutorial para subir Laravel 6, ya subí un proyecto en 6 que subió y funcionó muy bien, no sé si haya que hacer algo más con la versión 8.

¿Alguna observación o comentario de qué me esté haciendo falta?

De antemano, gracias por sus comentarios. Saludos!