Jump to content

Fatal error


Ben224
 Share

Recommended Posts

Hello fellow cubecarters,

I have been intermittently receiving a number of errors which are crashing my site. I have been working to resolve these errors with my webhosting company.

Until now I haven't found a resolve to this issue.

I have been receiving various errors namely:

500 Internal Server Error

also my web monitoring service reports:

'Connection Refused' - A Connection Refused error occurs when the web server's host computer is found, but the host computer refuses to accept the connection on the default port. This usually indicates a problem with your web server software or the web server software is not running.

and finally I sometimes have the following error in my browser window:

Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/oxoxoxox/public_html/classes/db/mysqli.class.php on line 22

Fatal error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/oxoxoxox/public_html/classes/db/mysqli.class.php on line 24

I am at a complete loss as to whether this is a coding issue or a problem with the host server who seem to be clueless themselves.

Your help is much appreciated in advance.
 

Link to comment
Share on other sites

Hi

3 very different problems here :

1) Internal Server Error - this is usually due to a mis-configuration at a hosting level - one cause can be invalid commands in an .htaccess file but there are many others

2) Connection Refused - this is generally caused by the server firewall but can also be caused due to an overloaded server

3) Can't connect to local MySQL server - this can also be caused by several different things but can also be indicative of an overloaded server

I would suggest that if your hosting company really dont have a clue, then it is time to find a new hosting company !

Thanks

Ian

Link to comment
Share on other sites

If this is intermittent, then I would say there is nothing wrong with the code.

 

If you have access to the web server's access log (it may just be labeled "log" in your hosting control panel) for your site, you may be able to verify if 500 responses are random, or if it happens only on a certain page.

Link to comment
Share on other sites

Thanks Ian,

 

I will consult with the Hosting company and request that the site is moved.

Ben

The problem is that any hosting company should be able to work out from the server logs what is going on and indeed should be aware of this situation well before it starts to affect users - whatever the cause of these issues, it is likely that other users are also being affected

Thanks

Ian

Link to comment
Share on other sites

If you are running CC529 as indicated in your SIG, I recommend getting that bumped up to CC5210.

 

There are two problems with CC529 that prompted a relatively immediate release of CC5210:

* Loading extra language files other than the main language file would crash PHP (/classes/language.class.php)

* Session management would randomly lose the session (/classes/session.class.php)

* Solves a session timing problem that was supposed to be specific to Internet Explorer, instead affected all browsers except IE (/classes/session.class.php)

Link to comment
Share on other sites

Thanks for these points Bsmither,

I am running CC5211, (I have updated my signature) so these points probably wont be part of the issue. I am now looking for the web server's access log to see if I can pull any more information out. I will update this post as soon as I have something.

I do get the feeling that this is not a coding problem but rather a server overload issue. I have 2 Cubecart installations both are CC5211 and one of the shops uses a dedicated IP address which performs very well indeed. Both are coded almost identically in terms of the skin. I think it's fair to say that a dedicated IP would not be prone to server overload which may explain why this problem only effects one and not the other.

Link to comment
Share on other sites

I am now looking for the web server's access log to see if I can pull any more information out. I will update this post as soon as I have something.

So is this your own dedicated server or a VPS where you have root access as you would need one of these to get to server access logs.

I do get the feeling that this is not a coding problem but rather a server overload issue. I have 2 Cubecart installations both are CC5211 and one of the shops uses a dedicated IP address which performs very well indeed. Both are coded almost identically in terms of the skin. I think it's fair to say that a dedicated IP would not be prone to server overload which may explain why this problem only effects one and not the other.

As I mentioned before this is almost certainly not a coding issue (although the Internal Server Error can be a "coding error" in the .htaccess file) but the other two issues are almost certainly a server overload issue.

Having a site on a dedicated IP address on a server does not separate that from the other server resources so would be equally prone to any server overload. There are several good reasons for using a dedicated IP address with CubeCart, but that is not one of them !

Ian

Link to comment
Share on other sites

Thanks Ian, Bsmither

 

My hosting provider cannot produce a server access log as I havent enabled Awstats in cPanel. But I am also told that I dont have access to server logs in any event. I appear to have hit a dead end with the error log.

Link to comment
Share on other sites

Hi Ben

awstats are different from server access logs and certainly wouldnt help with this issue. You should have a (or more than one as they can be produced in any local working directory) local error_log which may help but I am tending to go back to my first answer as your hosting company either dont seem to have a clue or dont care enough to help you.

I dropped you a PM on here if you would like some specific help with your sites

Thanks

Ian

Link to comment
Share on other sites

Thanks Ian,

 

The Hosting company is not very helpful. I have escalated the issues outlined here with them - yet again, and requested that they look into the server logs and identify the issue.

 

I will update the post once I have a response.

Link to comment
Share on other sites

Hi, so to close this thread, I have had some results back from several tests done on my site by my hosting company who have found that there are issues with the coding of my site which "needs optimization for a shared hosting environment". This apparently is the reason why the site goes down which ends up bringing my email down as well.

 

The majority of the tests that were done failed. And I have the following advice to consider:

 

1."Use gzip compression for transferring compressable responses".

I have added a bit of code to my .htaccess file which enables output compression in Apache. Not sure whether that is ideal?

 

2. "Compress Images".

Images are all jpg optimised for web, not sure how I can possibly improve on this really?

 

3. "Use Progressive JPEGs"

If I'm not mistaken this is not supported on earlier browsers, so for now its not an option.

 

4. "Leverage browser caching of static assets"

So being an ecommerce content changes rapidly and I dont want out of date content being served to my customers browsers. However some stuff stays fairly constant. I wonder is there a way to cache some content and not others?

 

5. "Use a CDN for all static assets"

I dont think my site performance should depend an awful lot on whether or not I use a Content Delivery Network. I mean I'm paying the Host to serve my content why should I pay someone else to do the same thing!?

 

So the bottom line here is that the Hosting company are apparently doing a great job and my site configuration stinks. Wow, I didnt see that one coming.

Link to comment
Share on other sites

4. The one thing I do not like is that there is a call for /js/plugins.php and /js/styles/styles.php, both of which are almost always static, yet my browser (Firefox) will always make a request for these "files".

 

3. If I recall, P-JPGs are supported on IE6. So how much earlier do you want to go? What I do not know is if the GD functions in PHP have a P-JPG setting. When CubeCart renders the source image to make the various properly sized images for the skin in use, at that point making them P-JPG would be a good idea. BUT... I am not convinced a P-JPG is any smaller in filesize than what we have now. So, in my opinion, 3 is BS. So is 2.

 

There has been a recent report of difficulties with a store hosted on Hostgator.

 

5. Yes, but paying how much? Is it a mini-Cooper with 20 clowns packed inside? What a circus!

 

CubeCart has coded the templates to fetch the jQuery platform code from the Google repository (a CDN). Even so, your browser should have been caching these resources all along. So, 4 and 5 is BS.

Link to comment
Share on other sites

I have had some results back from several tests done on my site by my hosting company who have found that there are issues with the coding of my site which "needs optimization for a shared hosting environment". This apparently is the reason why the site goes down which ends up bringing my email down as well.

 

What a load of garbage ! Is CubeCart the best ever optimised piece of software, No, but it is pretty good and is far, far from the worst out there and works perfectly well in a shared hosting environment (well one that uses decent servers that are tuned correctly). This is your host trying to deflect issues - most of the items they recommend are useful to have but none of them will make the difference between your site crashing or not - they will make it a bit faster

1."Use gzip compression for transferring compressable responses".

I have added a bit of code to my .htaccess file which enables output compression in Apache. Not sure whether that is ideal?

Using gzip compression is very useful and means less data is transferred between the server and the browser - it is also easy to implement !

2. "Compress Images".

Images are all jpg optimised for web, not sure how I can possibly improve on this really?

CubeCart uses the GD library which does a pretty good job but always best to upload web optimised images.

3. "Use Progressive JPEGs"

If I'm not mistaken this is not supported on earlier browsers, so for now its not an option.

Progressive images will give the website visitor the impression that the page is loading faster and will score you better on web page speed test sites. CubeCart doesnt create progressive images but the GD class could easily be changed to do this and I have added a github request to get this added

4. "Leverage browser caching of static assets"

So being an ecommerce content changes rapidly and I dont want out of date content being served to my customers browsers. However some stuff stays fairly constant. I wonder is there a way to cache some content and not others?

Browser caching of static assets wouldnt affect customers and you can choose what types of files are cached and for how long anyway - it is a good idea and again, relatively easy to implement.

5. "Use a CDN for all static assets"

I dont think my site performance should depend an awful lot on whether or not I use a Content Delivery Network. I mean I'm paying the Host to serve my content why should I pay someone else to do the same thing!?

A CDN will improve page load times, especially if you have visitors from locations far away from where your server is based - for larger sites we would always recommend a CDN but you have to be pretty large with a lot of visitors to justify this

So the bottom line here is that the Hosting company are apparently doing a great job and my site configuration stinks. Wow, I didnt see that one coming.

LOL - From other discussions we have had, we know that isnt the case !

Link to comment
Share on other sites

Thanks guys,



 

I appreciate all your comments and insight which has helped me return a better educated response to my hosting company. I think in terms of image compression progressive sounds like a good idea. If it holds up as far down as I.e 6. It would be quite useful to have Cubecart work that magic when uploading images, rather than having to FTP the images in. Perhaps something that could be added to a later version?



 

My largest document size uncompressed which is the homepage including all bells and whistles is 1801 KB. I find it hard to believe that a correctly tuned server cant deliver 1801 KB of data without crashing.

 Anyhow the gzip compression has proved to be useful and the site is a little more sprightly now.

I agree totally Cubecart does a fantastic job on a shared server. My other cubecart site which is bigger than this one performs very well indeed. It's so easy to get bamboozled by all the technical rhetoric and in this case I think the host is trying to bamboozle and side step the real issue. The site hasn't had any errors in the past few days so I shall persevere for now.
 

Link to comment
Share on other sites

"I find it hard to believe that a correctly tuned server cant deliver 1801 KB of data without crashing."

 

Even a badly tuned server can deliver HTML and all the resources it asks for. No doubt most of that 1.8MB is images - which must be an incredibly large count - followed by javascript and CSS. The actual HTML should be quite reasonable. (You can see all this in Firebug.)

 

But can a badly tuned server deliver your page and resources as well as 1000 other accounts on that shared server?

Link to comment
Share on other sites

  • 4 weeks later...

"What is the GD Library?"

 

This is a PHP extension. It is included in the PHP deliverable package, but one must edit PHP's php,ini file to tell PHP to load the extension in order for any of the library's features to be available to PHP applications.

 

In CubeCart admin, PHP Info, there is a section for the gd status.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...