Perl, CGI, and Apache
March 15, 2005 9:56 PM   Subscribe

I have a Perl script which is supposed to handle user registration. It works fine from the command line (perl blah.pl "username=blah&password=blah") but doesn't modify the file it's supposed to modify when run as a CGI script in Apache 2.0.

I'm assuming this is some sort of permissions issue, but I've done chmod a+w and chmod 777 on the file in question and still no luck. Is there something I need in my httpd.conf?

Apologies if this is a really inane question, but my brain is fried right now and the Apache docs might as well be Greek.

(Also: I know I shouldn't keep my user data in a file. Eventually I will switch to some sort of SQL database. For the moment, though, I'd like to get the authentication crap out of the way so I can work on the fun bits of my webapp.)
posted by IshmaelGraves to Computers & Internet (2 answers total)
 
Best answer: Try putting or die "Couldn't save user data: !$" after the open statements. Then, check your apache error log to see what complained and why.

Did you make sure the user apache is running as has access (+x) to the directory the file is in, and all its parent directories? Try suing to the user http runs as and editing the file as that user.
posted by fvw at 10:16 PM on March 15, 2005


Response by poster: That was it — Apache had write access to the file but not the parent directory. I had several die statements, but I was using a method from a CPAN module which was returning true even though it was failing, so they weren't helping me much. Much obliged.
posted by IshmaelGraves at 10:24 PM on March 15, 2005


« Older Two player card games   |   Coffeshop Wifi Social Networking Application Newer »
This thread is closed to new comments.