Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fatima1's avatar

deployment

hi all i had deploy my project successfully, now i have other laravel project and i want to deploy with the same domain

first project www.abc.net second www.abc.net/admin

how to do that??

0 likes
13 replies
vajid's avatar

www.abc.net www.abc.net/admin its same domain /admin is a route

what you can do is make a subdoman admin.abc.net

and make a virtual host for admin.abc.net and point it to 2nd project

fatima1's avatar

@VAJID - so there is no way to do like this?

www.abc.net/admin

and how to make virtual host?

Guru5005's avatar

create a folder /admin inside your root folder just repeat the same procedure as you have done with your main domain

vajid's avatar

what might be happening is for 2nd project your index.php is inside /admin/public/index.php to access it you have go to url abc.net/admin/public/index.php

solution

after making admin folder and putting all of your 2nd project code inside it. you have to change the location of index.php for 2nd project i.e move index.php of 2nd project from public folder to admin like this /admin/index.php

and you have to configure some setting so that your 2nd projects work after moving index.php.

in index.php
require __DIR__.'/vendor/autoload.php';
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';


fatima1's avatar

i put second project public folder into public-html/public-admin folder.

vajid's avatar
//1st project dir
app
public
config
admin
    //2nd project dir
    app
    public
    config
    vendor
    ...
    index.php// 2nd project index should not be in public
vendor  
and so on

also you can use same vendor folder for both project to save disk space on server

fatima1's avatar

@VAJID - it does't work. do i need to change something un virtual host?

vajid's avatar

@fatima1 what error you are getting no change is needed in virtual host

vajid's avatar

i think its looking for url /admin

try /admin/index.php or /admin/public/index.php

fatima1's avatar

@VAJID - still the same inly page not found

now what i did is

//1st project dir

app

config

admin

//2nd project dir

app

config

vendor

...

vendor

public_html

  1st project index.php

  admin

      2nd project index.php

it return this error

Warning: require(/home/abc/public_html/admin/../path/to/web/vendor/autoload.php): failed to open stream: No such file or directory in /home/abc/public_html/admin/index.php on line 24

vajid's avatar

in 2nd project change this line

require __DIR__.'/bootstrap/autoload.php';

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

Please or to participate in this conversation.