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!!!!!!!!!!!!!!!
David,
Thanks for your suggestions, I haver checked the logs but no error log, tried your suggestion and still Error 500
Sidabm
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.
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.
David,
Just cut the file size down to 300 records and it worked fine. the other script runs in less than 14 seconds
Sidabm
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.
I am thinking of moving hasts, any recomendations?
Can i take up your offer os the CSV Trick
Thanks
Sidabm
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.
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
Hi Sidabm,
A link is best, then I'll download it to my test server and take a look for you...
Cheers,
David.
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.