You are here:  » Error 500


Error 500

Submitted by sidabm on Wed, 2009-08-12 22:20 in

I have just purchased Magic parser and have created a script to parse and Argos xml file and the same script duplicated for sainsburys. when i run the sainsburys file it works fine and when i run the Argos script i get Error 500.

Help!!!!!!!!!!!!!!!

Submitted by support on Thu, 2009-08-13 06:29

Hi,

500 is an "internal server error", and might be indicative of a timeout issue, especially if the error occurs after about the same amount of time (e.g. 30 seconds).

Firstly, make sure that you have disabled the PHP timeout by using the following code at the top of your script:

  set_time_limit(0);

Another option is to ensure that your script is generating regular output as error 500 could be initiated by the server if it appears as if a script has crashed. One way to do this is to print a progress report every 100 records or so; for example:

<?php
  $counter 
0;
  function 
myRecordHandler($record)
  {
    
// your normal record handler code here
    
global $counter;
    
$counter++;
    if (!(
$counter 100)) print "<p>".$counter."</p>";
  }
?>

Also check to see whether you have access to your web server's error log (there may be a "log" directory in the home folder of your FTP account) as this should provide further information.

Hope this helps!
Cheers,
David.

Submitted by sidabm on Fri, 2009-08-14 19:35

David,

Thanks for your suggestions, I haver checked the logs but no error log, tried your suggestion and still Error 500

Sidabm

Submitted by support on Fri, 2009-08-14 19:50

Hello Sidabm,

Does the error immediately, or after about the same amount of time (and if so how many seconds) each time you try to run the script?

Cheers,
David.

Submitted by sidabm on Sun, 2009-08-16 19:39

David,

After about 14 Seconds

Sidabm

Submitted by support on Sun, 2009-08-16 19:49

Hi Sidabm,

Thanks - apologies for the delay in your comments appearing - I moderate all forum posts first to protect user's URLs and other sensitive information.

When you run the script that does not cause an error; does it run for more than 14 seconds?

Cheers,
David.

Submitted by sidabm on Sun, 2009-08-16 19:54

David,

Just cut the file size down to 300 records and it worked fine. the other script runs in less than 14 seconds

Sidabm

Submitted by support on Sun, 2009-08-16 20:00

Hello Sidabm,

That would imply that it is definitely a timeout issue.

The first step would be to ask your host if you could be permitted a longer timeout on your account. If you explain that you are loading a database they may be willing to give you a longer timeout in order to keep your business.

If they are not willing to increase your timeout; is it possible that there is a CSV (non-XML) version of the feed available? If so, I can help you with a "trick" that involves importing, say, the first 200 records; and then stop - and with a META REFRESH reloading the page from the browser with a "start" parameter and repeating this process until the entire feed has been parsed.

I am working on the ability to use the same technique with XML which should be ready shortly, so if CSV is not an option I'll certainly let you know as soon as it is available.

Cheers,
David.

Submitted by sidabm on Sat, 2009-08-22 18:15

I am thinking of moving hasts, any recomendations?

Can i take up your offer os the CSV Trick

Thanks

Sidabm

Submitted by support on Mon, 2009-08-24 08:15

Hello Sidabm,

Certainly.. would it be possible for you to email me a link to the feed you are working with and I'll work out the code for you...

Cheers,
David.

Submitted by sidabm on Mon, 2009-08-24 18:15

David,

Will have to post it on my server elsewhere as its behind security or i could send you a cut down version by email. Which would you prefer?

Sidabm

Submitted by support on Mon, 2009-08-24 19:21

Hi Sidabm,

A link is best, then I'll download it to my test server and take a look for you...

Cheers,
David.

Submitted by sidabm on Wed, 2009-08-26 21:20

David,

Sent you an email

Sidabm