Here's a wierd one for you...greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread |
Hi everyone,I use a very hacked and customized version of the scripts for shops and info request pages I have designed and It has always worked fine on my "hosted domain" using unix, appache, and perl5.
But I just got a "virtual server" to host domains for customers which uses unix and perl5 but uses NCSA HTTPD as the server system. I installed the scripts to a new domain I just created and the shop script worked fine but the admin script kept kicking out a "500 server error" with a errornum 2 in the error-log file.
I was tinkering with the scripts trying to figure out what was going on and I noticed a difference between the two when opening the database. The Shop script called it
---example: open (FILE,"$basepath$delim$resourcedb") but the admin script called it
---example: open (db,"$basepath$delim$resourcedb"); So I changed the admin script at the top of it from
to Here's where I changed it, from this: ----------------------------------------------------------------- open (db,"$basepath$delim$resourcedb"); &print_header;
while (
) { my($itemid, $name, $price, $descrip, $image, $weight, $itemurl, $group) = split(/\|/,$_); to this: ----------------------------------------------------------------- open (FILE,"$basepath$delim$resourcedb"); &print_header;
while (
) { my($itemid, $name, $price, $descrip, $image, $weight, $itemurl, $group) = split(/\|/,$_); ----------------------------------------------------------------- And it WORKED!!!! when I called out the admin script it executed perfectly and I ran it through all it's paces to make sure nothing was wrong and everything worked.
Now, my question is this: What the heck did I do and why would it work one way on apache and another way on NCSA HTTPd? Is there a reason they are called out different in the two scipts?
Hopefully this will help someone else out with the same problem. I would appreciate any Gurus out there to explain this to me if you have the time.
Thanks for keeping this thread going strong,
-- Marc Burnell (efxweb@efxweb.com), April 25, 1998