0
votes

Is there anyway possible to install a Laravel PHP application into the same directory?

What I mean is as I see it, you have to install the whole Laravel application 1 directory under the the main Public directory.

I know that you can change the Public directory to anything in the settings but the server my client has, they really need for everything to live in 1 directory.

Current Folder Structure....

app/
bootstrap/
vendor/
public/
artison
server.php

If this was all dropped into a Public directory on the server, then you would have to access the application/website at the domain www.domain.com/public/

I am hoping there is a way to put all these files/folders into a public or www htdocs type folder and still access the application at the root.

I know the main reason to keep the PHP files out of the Public accessible folder is for security but in my clients situation this is not possible the way there server is configured.

Surely there is a way to do this?

1

1 Answers

1
votes

Try putting contents of public in same directory as other folders, and then edit your index.php previously in public to look something like this

require __DIR__./bootstrap/autoload.php';

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

I haven't tried this. Just came to my mind right now

Anyway, I'm doing this by keeping app, boootstrap, vendor in / of my hosting, and contents of public are in my public_html. It works fine, and I guess it could be a security plus.