admin panel errors on production
Hello guys,
so I hosted my app on sharedhosting and I encountered this error on admin panel which kinda tricky since it only appears on production and I have this image on console log also comes on error trigger.
I tried .htaccess issues but didnt it didnt work.
Thankyou in advance!!
51 Replies
It's a common error I think... there are a couple of solutions here :
https://github.com/livewire/livewire/issues/1779
But likely a weird server configuration issue on the side of your web host. You should try contacting them.
I have no idea if one of the reasons was my provider.
I wish this is just something that I can work with to sort it out since im in urgent, I havent have this problem before on admin panel, only happens now but Im still figuring it out what causes it.
but thankyou, I'll try to take a look on the thread u sent.
Did you storage link? And it looks like the web root isn't setup right. Shared hosting is a bit of a PITA depending how the server is done.
Totally, I hate to be that guy (hated seeing this "advice" earlier in my career) but don't do shared hosting if you have any other options. It's absolutely not worth it.
yes sir.
hmm about the server.. my system files were on public_html
so my root is public_html
then I have this .htaccess
thats all I did to make it work
I haven't run to this issue last week, only now though..
@pboivin
I acknowledge the tips, I just cant afford it right now im sorry for the incompetence.
Your public should be public_html/public
like this sir?
RewriteRule ^$ public_html/public/index.php [L]
RewriteRule ^((?!public_html/public/).*)$ public/$1 [L,NC]
I've never done it as a rewrite rule it's always flaky. I've just done it as part of the hosting you can set the domains root.
But this is more of a laravel issue opposed to a filamentphp issue.
hmm, ok thankyou sir, I'll try other solutions.
Is it cPanel?
Can you say what the hosting company is?
z.com sir
all I checked from the provider was php version
Ok... looks like you should have cpanel, no?
I have sir
I've run composer update on their terminal and storage update etc.
Idk if there's something I should still run via command
but npm commands doesnt work
I forgot everything I knew about cpanel but I think you should start there, google for "how to configure cpanel for laravel", it should give you a list of ideas to check in your configuration
Techalyst
Change Hosting, Domain Document Root for Laravel Project
Change Hosting, Domain Document Root for Laravel Project
note sir, thankyou.. @pboivin @toeknee_iom
basically all of my pages that has livewire polling are returning the same errors
update:
I disabled the erros on cpanel, updated .env APP_DEBUG=false so the error wont showup,
but then my console doesnt show any errors too.
I wonder why suddenly its working after disabling logging errors what causes it....
as of now its working fine, I standby on my dashboard for 5minutes and so far there's no error coming from console.log
this makes no sense if just disabling the loggin/showing error from cpanel and app_debug fixes the issue...
I don't know if this is what is happening for you, but often the reason front end issues go away when you turn off error reporting is that with error reporting enabled, informational warnings from PHP (often concerning issues which should be fixed but aren't actually breaking your app) get injected into AJAX responses from the server, which then causes any Javascript which interprets the AJAX response to error out. This is one of the many reasons you should disabled debug and error reporting in production.
Ensure you have a proper error reporting tool like sentry or flare so you can actually get the errors and fix them behind the scenes.
Thankyou Sirs for usable tips!
UPDATE:
I did some digging and I found out that the error more often comes if im using incognito
also if I spam the filters of my charts/tables/widgets the error will show
this is the error looks like when error logging was off and app_debug = false
this could be a problem to me since my filters have so many values whereas there will be a case where if the admin wanted to check all of the filter then it will be considered as spamming then the error will show up.
Sounds like your server is hitting a mod security rule / filter to prevent injections etc. Check the server error logs and you should see the rule hit, then contact your host to whitelist it.
Hello, I'm starting to think that if I should use other server platform instead coz this sharedhosting wasted too much of my time.
do you have any suggestions that is affordable?
DigitalOcean, $5 a month it's what filamentphp website runs on.
ideally you should be using a deployment / setup service like forge.
what does forge does?
It builds the servers and deploys your application from github. It's basically a fast streamlined, no-low-code deployment.
Hello Sir, this is my error_logs,
hmm is this something that only server can resolve?
Speak to your host, it clearly states denied by server configuration. They will need to whitelist the rule
I've already filed a ticket, thankyou sir!
If they can’t help, you can disable mod_security which is likely the culprit but ideally you shouldn’t for security reasons.
Hello Sir,
I dont see any modSecurity on my cpanel
You would do it in the .htaccess as it's unlikely your host is given you access to the mod_security rule.
hmmm,
upon searching
is it something like this?
all of result searching solutions on how to disable it on .htaccess didnt work...
im doing it on my public_html/.htaccess
Hello @toeknee_iom
they responded to me, atlast, it took them almost 3 days
this is what they replied to me..
these are my files on public_html, htaccess, index.php
.htaccess
index.php
Their response smells like bullshit to me. The error clearly showed it being denied by the server. And no, there is no /livewire folder, but that's irrelevant, it's a route, which doesn't have to corespond to folder structure.
It does seem like time to find a better hosting solution. Get a free single site Ploi account with a $5 Digital Ocean droplet, install your app there and see if the problem goes away.
As hugh points out, it's bullshit. 405 error is never triggered within Laravel (I've just double checked the source code).
Notice, it says: Client denied by Server Configuration in the logs?
Just stop messing with the hosting and run a $5 DO server which can likely run the majority of your sites 🙂
^^
It'll be a short term pain for a large long term gain.
100%
Hello Sir
I replied the same thing and they said they'll look into it again
I'm losing hope for their cooperation.
Hello Sir,
Can I still use the same domain? if I switch to DO?
You can use any domain… just update the DNS records.
What should I choose here sir?
is the $5 dollar enough?
$5 is, but I would highly recommend you use Forge to build it. You'll probably strugle with it doing it that way if you are technically savey
SnapShooter
How to Deploy Laravel on DigitalOcean with Forge - 2020 Full Guide
Once you have finished deploying your product/project on of the most rewarding steps is getting it in production. This guide is going to use forge a tool for
^^^ this.
Unless you have a decent amount of experience setting up servers, use Ploi or Forge to deploy it. Then you don't need to know anything about setting up nginx or MySQL or PHP or Redis or supervisor or cron or (etc etc). Just add credentials and push some buttons in Ploi/Forge.
As I mentioned up there ^^, Ploi have a single server free account you can experiment with.
Ploi have a single server free account you can experiment withDid not know that, it's super cool! AFAIK forge also has a free trial period you can use to provision 1 server.
I mostly use Forge, but have a Ploi account and currently one client deployed with it, and both do the job. Ploi arguably have more / better features.
Same, long time Forge user but I'm curious about other options. I'll give Ploi a try on a next small-ish project.