Jump to content

[SOLVED] Please, Please Help. 500 Internal Error on payment modules


Recommended Posts

Hi All,

 

I know what you thought when you clicked this post, he has a permissions issue. I can assure you that after 2 weeks of googling and searching this forum, this is not a permissions issue.

 

PayPal works Fine, but only if I don't use a password in the API details section.

 

All other payment modules do not work. I think it is something to do with the data stored in either my theme folder, img folder, in the database or due to me using a subdomain.

 

Why do I think this.....?

 

I have done several fresh installs of Prestashop from CPanel and From Download. I then test them right after the install and everything works fine.

 

I then move over my Themes folder, and copy the images across (about 100,000) of them.

 

I delete all tables in the database and restore the tables from my live shop which as about 28,000 products configured.

 

I then test the database and all works perfectly until I get to validation.php when I get the following error. http://store.candmpets.co.uk/modules/cheque/validation.php

 

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

I have tried setting permissions on files and folders to 700, 705, 744, 644 and every other combination there is but still no joy. Buy it can't be a permission error, because as I said above after the initial install everything works fine with the default permissions and I can complete the checkout.

 

I am now into about 50 hours of debugging and need help.

 

HELP!

 

Thanks

Simon

Link to comment
Share on other sites

Thanks for the quick reply Mike

 

 

Server information

 

Prestashop Version: 1.4.8.2

Server information: Linux #1 SMP Tue May 15 06:02:20 CEST 2012 x86_64

Server software Version: Apache

PHP Version: 5.3.10

MySQL Version: 5.5.24-cll

Store information

 

URL of your website: http://www.store.candmpets.co.uk/

Theme name used: prestashop

Mail information

 

Mail method: You use your own SMTP parameters

SMTP server: smtp.gmail.com

SMTP user: Defined

SMTP password: Defined

Encryption: ssl

Port: 465

Your information

 

Information from you: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11

AdminInformation.gif Check your configuration

Required parameters: OK

Optional parameters: OK

Link to comment
Share on other sites

OK,

 

I have run some tests on the Cheque module by putting the following code after each line of code

 

echo "I am here";
exit;

 

Then doing then clicking confirm order and if I see "I am here" on the screen I know everything is OK upto that point. I then move these two lines of code down a line and do the process again until I get the 500 error.

 

The 500 Error occurs on this line of code.

 

$cheque->validateOrder((int)$cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $cheque->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);

 

Can anyone shed any light on why this would cause me this error message

 

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Many Thanks

Simon

Link to comment
Share on other sites

Hi Mike, here are the two items from the error log but they dont really tell you much.

 

[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/favicon.ico
[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/500.shtml, referer: http://store.candmpets.co.uk/modules/cheque/payment.php

 

Thanks

Simon

Link to comment
Share on other sites

Hi Mike, here are the two items from the error log but they dont really tell you much.

 

[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/favicon.ico
[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/500.shtml, referer: http://store.candmpets.co.uk/modules/cheque/payment.php

 

Thanks

Simon

 

Have you tried calling your host directly for more information yet?

 

-Mike

Link to comment
Share on other sites

I have just submitted this ticket to ukhost4u.com tech support.

 

Will let you know when I get a response. They are normally very good.

 

Hi, Hope you are well.

I am have a very difficult time trying to get Presta Shop Payments working. Please the ticket URL I have pasted below if possible, the last reply back from PrestaShop Support is asking if I can get more information from your server logs. You will see in that post, a section of the error log I got from CPanel, along with dates and times.

Would it be possible for you to check if you have more information in your logs for any errors a couple of minutes before and after this time. ([Tue Jul 10 21:39:36 2012] )

http://www.prestasho...ayment-modules/

Many Thanks

Simon

 

 

 

 

Thanks

Simon Carr

Edited by simoncarr (see edit history)
Link to comment
Share on other sites

HI Safa,

 

As mentioned in the initial ticket I have tried all combinations of security already and no joy. As the ticket says the server is reading validate.php, but is failing on a very specific prestashop function. validateOrder()

 

Thanks

Simon

Link to comment
Share on other sites

Here is the response and logs from ukhost4u tech support

 

 

I am pasting server apache logs below.

 

===============

[Tue Jul 10 20:53:09 2012] [error] [client 75.147.222.174] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/favicon.ico

[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/500.shtml, referer: http://store.candmpets.co.uk/modules/cheque/payment.php

[Tue Jul 10 21:39:36 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/favicon.ico

[Tue Jul 10 21:44:04 2012] [error] [client 81.155.150.243] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/img/p/2/3, referer: http://store.candmpets.co.uk/health-hygiene/17184-4fleas-dog-shampoo-5ltr-5000476040932.html

[Tue Jul 10 21:48:44 2012] [error] [client 94.170.244.133] File does not exist: /home/simoncmz/public_html/candmpets.co.uk/store2/favicon.ico

 

===============

 

There is nothing more in there than in the logs I got from the Cpanel Error Log.

 

Does anyone know which file the validateOrder() function is in? If I new this I could do some further testing to try and home in on the specific error.

 

Thanks

Simon

Link to comment
Share on other sites

OK, I found validateOrder() if anyone is looking for it, it is in classes/PaymentModule.php

 

I did the same debugging on this module as I described for the cheque module above. using

 

echo "I am here";
exit;

 

after every block of code and manged to interrupt the code until I got to this block.

 

if (isset($outOfStock) && $outOfStock && Configuration::get('PS_STOCK_MANAGEMENT'))
   {
 $history = new OrderHistory();
 $history->id_order = (int)$order->id;
 $history->changeIdOrderState(Configuration::get('PS_OS_OUTOFSTOCK'), (int)$order->id);
 $history->addWithemail();
   }

 

before this block I can interrupt and break out of the code, after that block the web page times out with a 500 internal server error. Can anyone help me with understanding why this would happen?

 

Thanks

Simon

Link to comment
Share on other sites

OK, so specifically it seems to be this line that I can not get past within the code block above

 

$history->addWithemail();

 

However it takes a good deal longer to get there than it should. If I put the exit statement on the line beofre it takes about 20 seconds to get there. But should not take more than a split second, so something else is also going on. I was wondering if the page was just timing out and the line above is just as far as it gets, but then that would not result in a 500 Internal error.

 

What could cause the system to slow down. It't cant be the number of products, because all other functions work fine, including PayPal.

 

Any ideas anyone?

 

Simon

Link to comment
Share on other sites

WhoooooooWhooooWhooooooooWhooooooo.

 

I found the Problem. After going through every line of code in the paymentsmodule.php (validateOrder function), I finally found the problem.

 

It was when I got to $history->addWithemail(); as mentioned above, that Prestashop crashed and gave me a 500 error. The problem was that I have Prstashop to send email through my Gmail account. For some reason during the database transfer from my test server to the live server, the credentials mush have become messed up. It could no longer send email, and rather than giving an informative error, it just gives a 500 Internal Server Error.

 

One good thing has come out of it, I now know the prestashop codebase, especially the Payment functions like the back of my hand.

 

I really hope that this helps someone else in the future who is struggling.

 

Simon

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...