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

sllem's avatar
Level 1

Deploy Laravel 6.4 to hosting server (get error 403 Forbidden error was encountered while trying to use an ErrorDocument))

Hi Everyone, I'm new developer and I try to install my project in the real website, but doesn't work. some body can help me please.

Thanks.

Jonathan.

0 likes
9 replies
jlrdw's avatar

What host, and did you upload or put the .htaccess file on server if using Apache.

sllem's avatar
Level 1

One question, maybe the problem is because I'm creating in a sub-domain.

jlrdw's avatar

Update your document root to point to public_html/your-chosen-folder-name Where public_html is public_html or htdocs or www, depending on the host.

I actually have a laravel site and a cakephp site on same host. Of course they are smaller sites, for a larger site, heavy traffic use digital ocean, aws, or one like that. I mostly do intranets for business use.

But the above guide actually works for laravel, yii, and cakephp with small tweaks.

jlrdw's avatar
jlrdw
Best Answer
Level 75

At the first image in the guide the dJ 3 folder, that's where you move the original contents of public.

And the same image you see the folder dj3core, that's what main laravel files go.

And the paths get adjusted.

There shouldn't be two index files. I shared that guide because it's worked perfectly for several setups.

sllem's avatar
Level 1

hi jlrdw, I found the problem. My problem was in the file .htaccess I need to add

RewriteEngine On RewriteRule ^(.*)$ public_html/$1 [L]

thank you for help, me, your links help a lot.

wlk's avatar

Hello I have been experiencing the same issue and none of your solutions worked for me.

Please or to participate in this conversation.