F
Filamentβ€’12mo ago
HardFist

I have problem when upload it to Share Hosting

When I upload laravel + filament to Share Hosting, when I go to domain.com/admin, it show 404. Is there something that I have to do after upload the project?
Solution:
Finally I fix it, I config the htaccess in the wrong way 😊
Jump to solution
16 Replies
Jr.Pikong
Jr.Pikongβ€’12mo ago
Make sure this code implement in User model public function canAccessPanel(Panel $panel): bool { return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail(); } https://filamentphp.com/docs/3.x/panels/users
Dennis Koch
Dennis Kochβ€’12mo ago
Shared hosting and Laravel are often a bad combination. It's hard to tell because there might be numerous issues with the server setup
SLy
SLyβ€’12mo ago
It can work if having ssh terminal available. Your problem might be because of .htaccess, can you acces via /public/admin?
HardFist
HardFistOPβ€’12mo ago
I'll try I just have this account to make a light blog. To make this web secure I used to move the project directory in the outside of public_html I cant 😦
Jordy
Jordyβ€’12mo ago
as Dennis said, shared hosting is rubbish with laravel.. its not worth it for the money you are saving
Dennis Koch
Dennis Kochβ€’12mo ago
You need to point the virtual host to public then If you can't change the virtual host config, you will need to jump through some hoops.
HardFist
HardFistOPβ€’12mo ago
I think theres a problem when I upload it, so I reinstall the Filament via cpanel terminal. Everything goes fine even when I make filament-user. When I check the database there is my user data, but I cant access the admin page
Dennis Koch
Dennis Kochβ€’12mo ago
Can you access any Laravel route?
HardFist
HardFistOPβ€’12mo ago
Okay I will try it Yes I can, just the filament page I cant access
Jr.Pikong
Jr.Pikongβ€’12mo ago
have you tried adding this code to the User model? public function canAcces Panel(Panel $panel): bool { return true; }
HardFist
HardFistOPβ€’12mo ago
Yes I modified the User model like in Documentation and like this, still same (404)
Solution
HardFist
HardFistβ€’12mo ago
Finally I fix it, I config the htaccess in the wrong way 😊
nazar
nazarβ€’2mo ago
i have same problem in shared hosting can give me the htaccess config 😒
charlie
charlieβ€’2mo ago
Stop trying to hack around htaccess... On most shared hostings, it's easy to install laravel: you just need to put your site in the root directory (outside public_html), and make your domain point to the public dir But you need ssh on your server to install composer packages, deploy, etc. If you only have ftp access, find another hosting provider, it's not worth it
Mohamed Ayaou
Mohamed Ayaouβ€’2mo ago
if you have no SSH access then you can just upload the /vendor too. but as mentioned such hostings not worth the effort unless you have no other options but a Digital Ocean droplet with the best cheap alternative.
charlie
charlieβ€’2mo ago
agree, but sometimes copying the vendor through ftp won't work, depending on the config/packages. And someday you'll regret not having ssh.

Did you find this page helpful?