Forum Moderators: coopster

Message Too Old, No Replies

Trouble using popen()

         

timmay82

1:07 am on Jul 27, 2006 (gmt 0)

10+ Year Member



I am trying to use popen() to run a perl script to parse a file and enter data into a database. The code is:

$pipe = popen("htmSaveDb.pl '$fullpath' ", "r");
$return = fgets($pipe,1024);
pclose($pipe);

The problem is the perl script never seems to actually run. When I check my Apache error log I have the error:

Access is denied

When I try to run the script it looks like a command prompt box briefly opens and then closes immeadiately. The first command in the perl script is a return statement so it should only be returning a string value into the $return variable. The problem is this script runs correctly on at least 4 computers and only one computer throws this error.

Any suggestions for what might need to be changed on the computer to get it running? The only difference between it and the other computers that I know of is it has a higher security level.

Thanks,

Tim

siMKin

8:04 am on Jul 27, 2006 (gmt 0)

10+ Year Member



It's probably a file permission problem .. although that seems strange, because i thought Perl scripts always had to have 755. but then again, i don't know too much about Perl.

you could also try to execute it with exec(), but i have no idea whether that would make a difference (actually my guess is that it won't)

timmay82

9:18 pm on Aug 5, 2006 (gmt 0)

10+ Year Member



Sorry I didn't reply earlier, its a little hectic I'm juggling 3 projects. I haven't gotten a chance to try out exec but I will let you know if it works when I get to it.

Tim