Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP OR SERVER ISSUE?


kpenn

Recommended Posts

Is it possible for a script to work sometimes?

 

The problem arises when returning to site after Paypal purchase. The script seems to hang (loading) but no error messages. Even when typing the URL (http://xxx.com/checkout_process.php) its stuck loading. I’ve done many test – some where successful, returning me to checkout_success.php via checkout_process.php (updating database and sending order email to store owner and customer) while others hang loading. Successful test leaves me to believe the script is working properly. The problem seems to be intermittent. I would make a successful purchase 10 minutes prior to an unsuccessful purchase.

 

When using the URL for checkout_success.php while page is hanging, I do reach the proper page with variables passed. It seems that the script still ran its course up until and including the send email command (order emails are delivered up to 24 hrs late).

 

I’ve been talking with web hosting. Was told of a problem at the server which handles mail sent through web-based mailing forms. Their system administrators connected this issue with the queue on our smarthost server. Once they claimed to have resolved the issue, I still did not see any change on my end. They then ran a purchase test and came across the same issue (page hanging). They said after redirecting from paypal to the shop http://xxx.com/checkout_success.php gave them a virus warning message – and pointed that out as the possible issue. After scanning and cleaning my account , they reported that no malicious code or files have been found. Ran 3 more test purchases and the problem still persist.

 

Php newbie and don’t know much about server but here are my findings: Checkout_process.php

Line 344: redirect to checkout_success.php (failed)

Line 327: reset shopping cart (failed – still populated during re-visit or url is used)

Line 315: send order email to store owner and customer (success – delivered late yet delivered)

Line 273: collects order details (success – info for order email processed)

 

PHP OR SERVER ISSUE?

Link to comment
Share on other sites

PHP OR SERVER ISSUE?

you need to check the error logs for your webhosting account.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

PHP OR SERVER ISSUE? IT SEEMS TO BE A BIT OF BOTH.

 

TECH SUPPORT:

"As your account located on the windows server, php unable to send 2 and more emails at once. This is not a specific problem of our server but rather peculiarity of php work on the windows server. PHP is not native to Windows operating systems and was designed for Linux system where such problem should not nor occur.

 

In order to resolve this issue you should modify your script, so that only one email send at once.

Please check admin control panel of your shopping cart and if the option "Send Extra message" or something similar is checked you should uncheck it. This should the resolve the issue.

 

As at first your script tries to send emails, if the messages were sent successfully only after this it will redirect back to the shopping cart.

Please modify your code according to this information."

 

1. Removed store email address from ADMIN/CONFIGURATION/MY STORE/SEND EXTRA ORDERS EMAILS TO – Problem persist.

 

2. Commented out lines 316-318 (// send emails to other people) checkout_process.php - Redirected to checkout_success.php as it is supposed to but no order email sent to client.

 

COMMENTED OUT THE FOLLOWING:

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

LIKE SO:

 

// send emails to other people

// if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

// tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// }

As I said, it redirected to checkout_success.php as it is supposed to but no order email sent to client.

 

How should I proceed? & How do I modify php properly?

 

A. stop mail from going to store owner - a disadvantage but could live with it. After notified from Paypal (Aggregated), I’ll get order details from admin

 

B. or any suggestion that balances out the pros and cons

 

Thanking you in advance.

Link to comment
Share on other sites

What does your host regard as "sending two emails at once"? Within a second or two of each other? PHP includes a sleep(n); function, where you might use it to sleep for a couple of seconds before sending the second email. More than 2 or 3 seconds might be an unacceptable delay to the customer, so see what your host requires for an interval.

 

An alternative might be to log the info to a file (append to it) and several times a day email or transfer it to you in some way, and empty out the file. Not without its risks, if a new order comes in and adds to the log after you've read or mailed it, and just before you erase it! You may need to do a lock() on the file during the read and erase, which 1) may not work on Windows 2) may cause the customer to see an error message or lose their order.

 

A second alternative would be to drop Windows and go to a real server (Linux). As your hosting service doesn't seem to be interested in supporting real commercial sites, this may be a viable choice. What possessed you to choose a Windows server, anyway?

Link to comment
Share on other sites

Thank you, I appreciate your suggestions. Tried sleep function (no luck) but it is hard to troubleshoot when your host is having mail delays and other server issues already. I can't recall my reason for choosing Windows but I will be switching to Linux (more than likely, a new host while I'm at it). Again, I appreciate your response.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...