Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Internal Server Error after switching hosts


Kenja

Recommended Posts

I just switched hosts for my established website and am now encountering a strange problem. Everything works fine until I press the "Confirm order" button in checkout. I get an "500: Internal Server Error" after the page processes for a few seconds. The error occurs when the browser is in the checkout_process.php file.

 

Here's the good news. The order seems to be placed okay and I do get the confirmation emails from the credit processor confirming payment. It also sends the email to the customer confirming the order. In fact, after reading down through the checkout_process.php file, it appears that most, if not all, of that file is being executed.

 

The bad news is that the customers will freak out when they press confirm order and see a "internal server error" message instead of the familiar order_success.php screen. I know I would!

 

It is the same exact website as is running on the other host, so I don't know why it would work on one, but not on the other. I read some posts on .htaccess files maybe being a culprit, but I can't seem to find any issues there.

 

I can't verify that these lines are being executed, so maybe one of them is the culprit?

 

// Include OSC-AFFILIATE

require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');

 

// load the after_process function from the payment modules

$payment_modules->after_process();

 

$cart->reset(TRUE);

 

// unregister session variables used during checkout

tep_session_unregister('sendto');

tep_session_unregister('billto');

tep_session_unregister('shipping');

tep_session_unregister('payment');

 

tep_session_register('last_order');

$last_order = $insert_id;

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 

require(DIR_WS_INCLUDES . 'application_bottom.php');

Link to comment
Share on other sites

There are quite a few things that can be different between the two hosting services. Different versions of PHP and MySQL can cause problems. There are also a large number of options and settings in PHP that can be different. I know that this doesn't help much, but it can give you some hints of what to look for.

 

If you think that most of the file is getting executed, I would temporarily comment out that Affiliate code and see if the process works. In fact, you might want to just put up an unaltered copy of checkout_process.php and see if it runs. If it does, then the error is in one of your modifications to that file. You can also comment out the redirect a the bottom of the file and add in some Print statements to see how far it is getting before the error.

 

The first problem is in finding out where the error is. Once you have that, it should be possible to figure out a way around the problem.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim,

It turns out it is the redirect statment that is throwing the error. Any idea why that particular line would cause an internal server error?

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 

Thanks,

Ken

Link to comment
Share on other sites

tep_redirect is used in quite a few places, so I can't see that being the problem. Possibly an SSL issue? That's another thing that can be different between hosts. I would also look at checkout_success.php, or just upload a fresh copy of that file.

 

You could also look at your server error logs for more information on the error.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...