vendredi 14 juin 2019

Laravel 5.5 | Migration from production server to local installation (laragon) | Broken link to public

I migrate a copy of my app from my production server to a local machine (laragon).

Connection to database work fine, just have an issue with broken link | url to css and js files when I'm loading the home page resulting in no style as you can see in the attached image.

After migrating my app, I moved the following files :

.htaccess
favicon.ico
index.php
robots.txt
web.config

from the root to the public folder.

I changed in the index.php file the following :

/*
|--------------------------------------------------------------------------
| 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 great to relax.
|
*/

require __DIR__.'bootstrap/autoload.php';

to

require __DIR__.'/../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__.'bootstrap/app.php';

to

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

In the env. file I set :

APP_URL=http://localhost

as the application url

The console error are among other the following :

bootstrap.min.css
url : http://mage.local/public/public/vendor/crudbooster/assets/adminlte/bootstrap/css/bootstrap.min.css
Failed to load resource: the server responded with a status of 404 (Not Found)


AdminLTE.min.css
url : http://mage.local/public/public/vendor/crudbooster/assets/adminlte/dist/css/AdminLTE.min.css
Failed to load resource: the server responded with a status of 404 (Not Found)

I saw the error by looking at the url which have the folder public set twice :

.../public/public/...

but I have no clue how to solve this issue. Would appreciate your expertise here. Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire