I am using Laravel 5.1
To get rid of Public folder:
-
I moved everything in a folder named 'root' except public folder.
-
Move all public folder content in Root.
-
Changed
require __DIR__.'/root/bootstrap/autoload.php';
&$app = require_once __DIR__.'/root/bootstrap/app.php';
in index.php at root folder.
Everything is working perfectly in localhost. I uploaded my project in a shared hosting. And change database information in .env and change the url in Config\App.php
'url' => 'localhost',
to 'url' => 'http://ift.tt/1jdbkqA',
.
Now when I go to myproject.com it shows a Parse error Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/zamzamtransport/public_html/index.php on line 50
index.php:
require __DIR__.'/root/bootstrap/autoload.php';
$app = require_once __DIR__.'/root/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
Another problem is my .env file is accessible.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire