Specific web page started to occasionally result in 500 internal error - php

I've come across an issue today where a specific page on my site is sometimes causing a 500 internal error. The page normally can take fairly long to load due to some database queries on large datasets, but only today has the apache 500 internal error started to happen. Obviously I will try to optimise the db queries as much as possible to improve page loading speed, but does anyone have an idea why this may have started to happen after having been fine for a couple of months? I'm not aware of any server wide configuration changes. Is it possibly a script execution time issue which needs to be modified in php.ini?

I had the same issue Here. Ended up having to move the site to a newer server. No resolution was found.

Check out http://bugs.php.net/bug.php?id=28929

without error logs its quite a guessing...
it could be memory-limit
or
execution time
check the php settings and change them.
since the data-value in your db is growing its normal that such problem shows up after a while. you'll have to refactoring the "page" specially your queries.

Related

I have got an error from page speed insight

https://developers.google.com/speed/pagespeed/insights/?hl=ja&url=https%3A%2F%2Fwww.wisebk.com%2F
Our web site got an error
Sometimes it is ERROR TIMEOUT , sometimes ACCESS DENIED error.
Does anybody know why this website got an error on page speed insight?
https://www.wisebk.com/
This is wordpress website.
Because your site doesn't respond fast enough, it took nearly 30 seconds to send the first byte (for your server to respond).
This could be a regional thing as Page Speed Insights servers are in the US (and I am in UK) so perhaps read this answer on how to run Lighthouse locally (the engine behind Page Speed Insights) and see if that works (or initially just run Lighthouse in Google Chrome Developer Tools).
Other than that it is a symptom of an overloaded server or something that is wrong with your theme (perhaps trying to dynamically build the page from the database and there is a very long running database query), could be hundreds of things but that is the reason Page Speed Insights isn't working for you.

Script timed out before returning headers: index.php

I'm getting this error on a magento installation in the server logs and the site is throwing a 500 internal server error.
I haven't changed anything that I think could cause this. Does anyone know where this error is coming from and what the fix is?
Is anything mentionned in the server logs? I am willing to bet you will find your true answer there.
500 is an internal fatal error, usually permission related, but other issues can also cause this, improperly configured vhosts, improperly configured .htaccess ... and many others. Check your server logs you should have more details on the error.
What were you trying to do that caused this error to appear? I get it from time to time when I do something labor intensive. For example, I'm in the process of importing around 10k products into my Magento build and got this same error message. In this particular instance, I'd be willing to be it has to do with either your Apache timeout setting or your PHP max_execution_time setting or a combination of both. It could also possibly be your PHP max_input_time setting if your like me and trying to upload/parse a giant CSV file full of products. Don't be discouraged either if you have to play with the numbers little bit to find the right combo to make things work. I have to try 3-4 times to get mine to run successfully.
A couple posts that helped me out were Script timed out before returning headers: php.fastcgi and http://www.magentocommerce.com/boards/viewthread/74021/#t213112.

What would be the cause of server closing a connection before data was sent?

I have a cakephp (1.3.10) application that seemed to work fine, but recently I get an error page that shows "No data received" in chrome. This happens randomly on various pages and in various browsers. I googled the the error and found only unrelated information.
I haven't changed any code or upgraded the framework nor did we do any updates on the server that is running the application.
What could be the cause of this?
Is this code related, if so where can I start looking to solve it in cakephp?
Any help will be greatly appreciated.
"No data received" could mean
A problem in the web server
a PHP script dying due toe a fatal error (although I think a 200 should always be emitted... depends on the server configuration I guess).
If you're using Apache, check out its error.log first. Chances are there is something enlightening in there.
If that doesn't help, you could try logging your PHP errors into a file.
If it happens randomly it might be an issue with your script running into an timeout or using too much memory. I had this issue once with wordpress as wordpress sometimes calls an internal "cronjob" on page views from time to time.

AMFPHP Bad Version error when having multiple simultaneous calls to gateway.php

I'm currently using AMFPHP 1.9 to make a simple flash game which uses a game server.
Sometimes, I get this error (BadVersion) when there are simultaneous calls to the server.
I've searched the web for some of the answers to this problem, and it seems they were answered back in 2004.
Is there an updated version of how to solve this problem?
I tried to change the globals.php parameters to use absolute path, like performing the below:
//$servicesPath = "services/";
//change to
$servicesPath = "/httpdocs/Flash/AMFPHP/services/";
but I cannot even go to the services browser when i changed it.
Updates:
I managed to change to the correct path (by getting the path using a custom php which displays get_cwd())
So services browser is up now.
However, i still get the timeout every now and then. (my request to the server is at about 5 mins interval)
I tried to spam querying to the server to determine if it was due to simultaneous calls, and realized it is not. (my local flash spams 30 X 3 requests / second and it work fine )
So now I suspect it might be due to timeout of the netconnection or something similar?
Update: Added keepalive call to server every 2 mins interval to see it it occur again.
Webserver timeout seems to be set to 180 seconds.
There was actually a new version released very recently (last 2 weeks) so definitely check that out to see if it helps.
I don't know your system (obviously) but I doubt that your absolute path there is correct, I would verify that, or set it back to the default. (It would probably start '/var/www/...' or similar)
I've leveraged amfphp on quite a few high traffic sites, and have never seen this error as a result of that, so definitely don't ignore other possibilities. Look carefully at the data your are sending/receiving for any possible errors there. Can it be encoded properly? Are their special characters, perhaps accent characters?
Try to narrow down the source of the error, is there one call that is always causing it? Perhaps try logging the results.
Goodluck!

Apache comes back with nothing

I'm running Apache 2.046 with PHP 5.x and I am experiencing very odd behavior on a CodeIgniter app.
The frustrating thing is that it is not consistent.
Occasionally when I call up my app Apache returns nothing. I mean nada. But then I hit refresh and everything works as expected. Sometimes I have to hit "refreash" several times before the page will load. Other times it comes right up. When I started this post it was happening 80-90% of the time. Now I can't seem to make it happen. But it's been happening for several days so I have confidence in the next couple of page visits I will see it again.
This is on a development box that has very little traffic. When I do a PS I see several HTTP threads running - "top" reveals nothing un-expected (like a runaway process).
When I tail the apache access logs I don't even see a logged request when Apache returns blank. No Apache or PHP errors are being thrown.
I mention codeIgniter mostly because we're using the recommend .htaccess file with Mod Rewrite. So I wasn't sure if that was contributing to the issue. It also does not seem to be a problem with non-codeIgniter apps. That's hard to say with confidence since the issue is so inconsistent.
It does not seem to be client issue as we're seeing this happen from multiple client machines.
I can't tell if this is a server (hardware) issue, Apache issue or coding issue. Maybe it's a memory issue?
Any thoughts?
NEW INFORMATION:
IN the PHP log file I received this:
PHP Fatal error: fatal flex scanner internal error--end of buffer missed in /data/www/coreLib/codeIgniter/system/libraries/Hooks.php on line 226
Blank pages when using CI are usually caused by php errors with error messages suppressed.
Try re-enabling them and reloading.
error_reporting(E_ALL|E_WARNING)
If you suspect your Rewrite rules are the source of the problem, then crank mod_rewrite's logging level up and find out. Otherwise, the fact that everything works normally outside of your app makes this sound like it's a problem with your code or possibly the framework itself.

Categories