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

CodeCanyon's avatar

Access denied for user and Error exception for Lravel 5 site in hostgator shared hosting

Hi, this is my first question here and it's regarding Laravel 5 site installing on Hostagator shared hsoting server. I have developed a web site in Laravel 5 and i needed to put it on my client's main domain.In localhost with Apache and MySQL it works great.In production environment also it works when accessing with "public" after main domain as Laravel normally works such as "www.maindomain.com/public".

But i need to access it directly from main domain instead of adding "public" to end of the URL. So i followed several tutorials including stackoverflow one to do that.As they mentioned i put all the public folder content into the root of the server and created a separate folder and added rest of the files to there. Then i changed index.php file according to the relevant paths. I did the same in localhost as well to verify whether this works. It works perfectly in localhost and but not in the sever. I'm getting,

"Whoops, looks like something went wrong." page with "PDOException in Connector.php line 47: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)" and "ErrorException in compiled.php line 6195: file_put_contents(C:\xampp\htdocs\laravelsite\storage/framework/sessions/0542689f28f88dc42fa24157896dee62bde734d9c1): failed to open stream: No such file or directory"

Hope someone will help me to solve this since i'm stuck at this point and can't deliver the site to the client. Thanks

0 likes
2 replies
CodeCanyon's avatar

Hope someone will help me to solve this issue.I'm really stuck here with my project deadline due to the issue.So please someone help me...

CodeCanyon's avatar
CodeCanyon
OP
Best Answer
Level 1

Still i'm having this issue.So please please can someone help me on this?

Please or to participate in this conversation.