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

faheemakbar18's avatar

Two laravel apps on shared cpanel hosting

hope you all are well

I have a shared cpanel hosting. I have to deploy two laravel apps. one as main domain. second as subdomain created in cpanel. I can create subdomain folder in home directory or inside public_html folder

For a single laravel app, I would put all the content outside public_html folder and public folder content inside public_html and do some changes in index.php to hit public_html instead of public

But I dont know how to do it with two apps.

0 likes
6 replies
faheemakbar18's avatar

That's how I upload a single app on a shared hosting. But my shared hosting cpanel doesn't offer separate public_html for subdomain. There's only one directory.

MarianoMoreyra's avatar

Hi @faheemakbar18

You can actually publish both applications’ public folders inside public_html.

What you’ll have to do then, is to configure each domain / sub domain at cpanel to have the corresponding folder inside public_html as its document root.

By default your main domain should have public_html as document root so you’ll have to change it too to something like home/user/public_html/application_one

I’m sorry I can’t give you a more complete answer but it gets kind of difficult from mobile sometimes hehe

Hope this helps!

1 like
Snapey's avatar

when your host offers you a subdomain capability, it is usually resolved out of a folder within public_html?

MarianoMoreyra's avatar

@snapey at least in my case GoDaddy allows me to pick up any folder below my home directory as the Document Root for that subdomain.

So you could choose a folder outside public_html, but I suggested placing both within public_html because it seemed ok based on @faheemakbar18 description.

MarianoMoreyra's avatar

I just confirmed that even suggest me the document root /home/user/public_html/subdomain after finishing typing the new subdomain name, although I usually change that to use a different folder destined for all my subdomains.

Please or to participate in this conversation.