CRE Loaded Community

Banner


Board index » Loaded Commerce Support » Bug Issues

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Tue Jul 19, 2011 11:17 am 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
ERROR LOG IS: Premature end of script headers


So, I recently moved webhosts. Running PHP5.

Ever since I moved, whenever you try and change the status of an order from PENDING to PROCESSING, and you leave 'NOTIFY CUSTOMER' checked, it throws an INTERNAL SERVER ERROR 500.

The error log states:

Premature end of script headers: php5, referer: https://www.website.com/admin/orders.php

Could really use some help here. I am pretty good on CRE except I've tried every combination of fixes possible and it's been 2 weeks now. If you REFRESH the page, you'll get the ORDERS.PHP back, and the new STATUS is reflected in the ORDER SUMMARY screen, however inside the ORDER DETAIL, it still shows as PENDING where the ORDER SUMMARY screen shows as PROCESSING. The customer email does not send.

Here is what I've tried so far (all of these were suggestions from various forum posts across the web). All to no avail.

1. Changed up email.php class permissions to 755, changed all files to 755 (no go)
2. Added manual zlib compression_level in PHP.INI
3. Removed GZIP compression
4. Re-copied the files to the server
5. Removed extra line breaks in HTACCESS
6. Manually veriifed files for obvious issues (i.e. truncation, corruption)

Note: It also looks like this error is thrown occasionally when CREATE_ACCOUNT.PHP is called. My guess is that it's thrown when the customer email is going to be sent.

Your help, in any form, is appreciated.


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Wed Jul 20, 2011 4:04 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
Tried loading the free CE 6.4.1a version on the same server, testing for same problem?
Which version of php5 btw? Got any red crosses in the admin >> tools >> server info area?

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Wed Jul 20, 2011 7:39 am 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
Database: MySQL 5.1.55-rel12.6
PHP Version: 5.2.17 (Zend: 2.2.0)


All green check marks in admin > tools > server info

I suppose loading up a clean version will show if it's my version or it's broken code as opposed to ANY version not working on this host.

Is this your reason for wanting to load up 6.4 as a tester?


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Wed Jul 20, 2011 7:52 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
G Eg wrote:
Database: MySQL 5.1.55-rel12.6
PHP Version: 5.2.17 (Zend: 2.2.0)


All green check marks in admin > tools > server info

I suppose loading up a clean version will show if it's my version or it's broken code as opposed to ANY version not working on this host.

Is this your reason for wanting to load up 6.4 as a tester?

No - you're aiming to rule out server configuration ... at least then if the CE version works, it isn't the basic server config and you can check add-ons like zend optimizer/ioncube loader plugins for example in the actual store. 500 errors are easy to cause - if the store has had any code modifications done to it in admin/includes/functions I'd be looking there too.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Wed Jul 20, 2011 7:54 pm 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
soundzgood2 wrote:
G Eg wrote:
... if the store has had any code modifications done to it in admin/includes/functions I'd be looking there too.

Simon



The thing is that this installation worked perfectly before I moved to another host. The same PHP and MySQL version were on the old host. Thanks for your suggestions!


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Thu Jul 21, 2011 12:07 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
G Eg wrote:
soundzgood2 wrote:
G Eg wrote:
... if the store has had any code modifications done to it in admin/includes/functions I'd be looking there too.

Simon



The thing is that this installation worked perfectly before I moved to another host. The same PHP and MySQL version were on the old host. Thanks for your suggestions!

Well, you've possibly eliminated 1.5 out of a 100 of server related configurations that may be affecting your cart, and php has dozens of settings itself within it. Eg how is php being run? Suhosin set wrong? Still using an old php.ini file? Checked the obvious error logs and the /debug folder? Hosting company any help?

If it fails on a fresh 6.4.1a CE install, then it'll be server config or something missing from the req spec:
http://www.creloaded.com/pages/Minimum- ... ments.html

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Sun Jul 31, 2011 4:25 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
Have you contacted your host?

500 error is frequently thrown by mod_security.

If you are on a new host, you may be triggering generic rules which need exceptions filed for your application.

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Sun Jul 31, 2011 7:01 pm 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
Nimitz1061 wrote:
Have you contacted your host?

500 error is frequently thrown by mod_security.

If you are on a new host, you may be triggering generic rules which need exceptions filed for your application.

David


Unfortunately, the logs say "Premature end of script headers in orders.php"

Did 3 2-hour sessions with host support. They went above and beyond normal hosting support and helped me at the application level. Still no luck. Had to comment out the tep_mail line in orders.php where changing the status of an order triggers an email. It's when that function is called where the error gets thrown. However, as soon as a session is established (by hitting REFRESH on the INTERNAL ERROR screen), the application works perfectly. That's what making this so hard to troubleshoot. You think you've found the problem, when you haven't. I officially gave up and had to remove customer notifications from their instance. They're not too happy about it and even offered to let me outsource the problem but I am confident no one else will get it either...they'll think they've got it but it will just popup again (and we'll end up paying a lot of people).

It sucks to have encountered an unsolvable issue. Or, I would have to take drastic measures to troubleshoot including installing another virgin instance and see if its at the osCommerce configuration level (gzip issue for example) or the server level (in which is would happen again on a virgin installation). If it's at my installation level, I am still screwed since I can't find it...If it's at the server level I am still screwed since Hosting company (mediatemple) can't find out what's causing it.

I have went through CREloaded paid support on a previous issue and didn't have a great experience so I have counted that out.

Bottom line. Screwed.


Last edited by G Eg on Mon Aug 01, 2011 5:03 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Mon Aug 01, 2011 2:46 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
I'd try a vanilla CE install, what's to lose? And David made a good point about mod_security - I've heard a couple of stories about oscommece carts failing with temple media due to security settings on their servers. And you also need to try (somehow) to speak with a tech (not support) before these guys really check things out.
No chance of changing back to the old hosting company then on a better hosting package?

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Mon Aug 01, 2011 2:50 am 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
soundzgood2 wrote:
I'd try a vanilla CE install, what's to lose? And David made a good point about mod_security - I've heard a couple of stories about oscommece carts failing with temple media due to security settings on their servers. And you also need to try (somehow) to speak with a tech (not support) before these guys really check things out.
No chance of changing back to the old hosting company then on a better hosting package?

Simon


Yeah, the 'change back to the old hosting company' is on the table but unlikely. The account got flagged for excessive MySQL queries and we outgrew Hostgator. Needed to switch to Cluster computing (which might be part of the problem).

I'll try the mod_security approach. Maybe we missed something. Thanks so much for the feedback, Simon.


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Mon Aug 01, 2011 5:00 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
Another potentially pertinent question here.

How was the migration done?

Look for excessive line feeds in orders.php, and for mixed EOL sequence types. Do a dos2unix on orders.php and delete any extraneous PHP open and closing tags.

Particularly - look for things like :

Code:
?>
<?php


in the file and remove them.

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Mon Aug 01, 2011 8:31 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2394
Location: New Zealand
I think this revelation:
Quote:
Needed to switch to Cluster computing

isn't going to help the cause either. My take on oscommerce carts - keep the server config as simple as possible to ensure some chance of success. Soon as you start complicating the server setup, running it through beta php versions, include javascript optimizers etc ... things will inevitably break.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Wed Aug 03, 2011 2:28 am 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
Still no luck. Thanks for all your suggestions.
My problem with this issue stems from 1 thing: Why is it, when I comment out the tep_mail line

Code:
//           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

            $customer_notified = '1';


that the problem completely goes away. That is a key indicator in this issue. The same function is called when a new customer account is created, right? I do see the same 'premature end of script headers' error on CREATE_ACCOUNT.PHP, presumably when the account is created and the email gets sent..or attempts to get sent.

Why would the tep_mail function throw an Internal Server Error? I even wrote a custom mail function in place of tep_mail

Code:
// mail($check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, null, '-f orders@website.com');


Still threw the error...well, if it won't do basic php sendmail, then that points to a server configuration issue. Any ideas what it could be? When I wrote a program that just used sendmail (a test contact form) it worked perfectly.


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Tue Sep 06, 2011 6:52 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
Possibly because the offending code sending output via HTML is in that function, or used by it. The issue is probably down in the functions folder in general.php or in the admin/includes/classes/email.php or mime.php files. Look at the end - remove excess carriage returns..

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: Admin Orders.php Error 500 When 'Notify Customer' Is Checked
PostPosted: Tue Sep 06, 2011 7:00 pm 
Offline
CRE Newbie

Joined: Tue Jul 19, 2011 11:04 am
Posts: 8
I did find an extra line in MIME.PHP at the end. I'll fire it up and let y'all know if it worked.

No extra lines in email.php, or general.php in both /admin and non-admin folders. That would make sense though since the error is triggered on email send.

Thanks so much for your input. Really appreciate it.

UPDATE: Nope. No worky. Sigh. This error is thrown whenever the status of an order is changed which triggers the email send. It's also thrown occasionally whenever a customer creates and account (and the welcome email is sent).

Never have had an issue like this dodge so much attempts at fixing. As a webmaster, it's pretty much one's worst nightmare.

I will likely have to create a special hack where emails are stored into a table, then cron-job sent every hour bypassing the direct send feature. Sign...what a hack.



Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@domainname.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.9 Server at www.domainname.com Port 443


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

Board index » Loaded Commerce Support » Bug Issues

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 17, 2012 9:26 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy