Quick question. I have a WordPress site which I am responsible for maintaining and ever since moving to DreamHost I’ve noticed I am getting quite a few 404 errors but they are ONLY when I publish/edit a post. Never when visiting the page normally or any other admin-dashboard page.
Here are the logs, can someone please tell me what I need to fix? I already have the ‘standard’ mod re-write stuff in my htaccess file (WordPress) and everything looks fine in all other logs.
The error “Premature end of script headers” is not a 404 error… I’m assuming you mistyped the error code and what counts here is the actual error message you posted.
“Premature end of script” means that the script failed to complete its action and unfortunately the causes for this are numerous. One of the most frequent causes of this problem is that your WordPress installation is hitting a memory limit and therefore the php process is killed while posting the article. There are some optimizations you can start doing (which will help your site, even if they may not solve the issue): https://help.dreamhost.com/hc/en-us/articles/215300867-General-WordPress-optimization-techniques
If you’ve applied those suggestions already, and still having issues, you can reply here with more details about your installation. Maybe there is a rogue plugin that’s eating up server’s RAM, or a .htaccess configuration that is causing trouble. When did these issues start? Do you recall changing something around the time they appeared? Are all plugins, themes and core WP running the latest version? Any detail you can share may help shed light on the issue. Feel free to open a ticket if you prefer to talk in private.
I’m quite certain I am indeed getting 404 errors when I publish/edit a page in WordPress. Maybe a script time out occurs and triggers my 404 template page load or something.
My 404 page template loads on the screen instead of refreshing the admin/post updated page you normally would see. The only way around is to refresh the page a few times, it eventually loads the published edited page. I can take a screenshot if you need to see, but it’s definitely a 404 page, it says so on the page itself. Something is triggering a “404” error page to load when I hit publish/edit. I googled the issue and found similar issues but no clear answer.
But your answer makes sense to me, I checked my WordPress memory limit and my server PHP limit (which I configured a while back when I first signed up with DreamHost along with a standard htaccess file). I installed a plugin just to test and see what the WP memory use is, and I have only hit 35% max according to what I see here, so I can’t imagine how I could be hitting a limit on the server end. The website is a very simple e-commerce style website with nothing close to “heavy traffic” or resources.
This issue has occurred from the first day I joined Dreamhost so perhaps there is a setting you guys can look at on my server side of things to fix it? Everything is up to date on WordPress, I don’t have a ton of plugins, I have optimized everything for load times, yada yada, etc I just sort of thought maybe it was a small server hiccup glitch or something, and I’m a patient man so maybe it’d work itself out but it’s been a few months, so I turned here.
I would very much appreciate a ticket and assistance if at all possible, can I do that here?
As a side note, the report of RAM by a WP plugin is probably not giving you the full picture because on shared hosting the php process can be killed by another wordpress instance that is not yours (the noisy neighbor issue). This shouldn’t happen too frequently though, and only a proper investigation on case-by-case basis can find out exactly what’s going on.
Thank you so much for the help, I figured the WP plugin RAM is separate than the server load but I figured too it was better than nothing to see at least if WP had an issue. But it’s using very little MB of RAM in the WP side of things. I will open a ticket. Thanks again.
I am confident that the 404 triggers are due to a memory issue of some kind when I am publishing or editing a page but I can’t for the life of me figure out why I (my php) would be taxing the server load that much to trigger errors like:
The web server reported a gateway time-out error.
Premature end of script headers
And only when I publish or edit, never get a 404 error outside of this scenario. No 404s from permalinks, plugin crashes, bad redirects, nothing. Just when publishing a WordPress page or post. Odd indeed.
Never had this 404 server load issue ever before with other hosts. Memory should be the same across hosts, no? Literally the same website I just picked up and moved over to DreamHost with no change. Theme and all.
Hope you can solve this for me so I can publish freely
No. The amount of memory you use should be broadly the same - although how the server is setup between hosts may affect this slightly.
However, the point about shared hosting is, you could be one of 2000 customers sharing a server - now, if you’re lucky the other 1999 customers all have a 1-page static web site with almost no views a month. If you’re unlucky there’s 1999 other busy web sites, bloggers, someone running a video viewing site, a shop etc…
Finally, you aren’t on just one server when you;re with DreamHost. There’s your web server for the physical part of your WordPress install - and then there’s the database.
That’s all I was talking about, my website’s memory usage. I have gone to great lengths to optimize it and I’m certain it’s nowhere near reaching unreasonable shared-hosting levels. I think under 100MB, and between 50-60MB of memory is nothing these days. It’s 2017. But I get what you are saying, of course shared hosting has other variables on their end.
Were you able to figure out the answer to what was causing your errors? I’m having a very similar problem with a site I’ve built that’s being hosted on a shared Dreamhost server and I haven’t been able to find a way to fix it yet.
Please read again my answer and open a new thread providing detailed information like: where is your site running? How did you install it? When did these issues start? Do you recall changing something around the time the issues appeared? Are all plugins, themes and core WP running the latest version? What have you tried to diagnose/solve the issue? Any detail you can share may help shed light on the issue.