For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > November 2005 > can't run perl script in /var/www/ directory









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can't run perl script in /var/www/ directory
bander8989

2005-11-19, 3:56 am

Hi

I tried to run a simple perl script ./test.pl under /var/www or
/var/www/cgi-bin, but no output showed
while i can run it under / without any problem
the permission of file is
[root@server cgi-bin]# ls -l test.pl
-rwxrwxrwx 1 root root 92 Nov 7 19:52 test.pl

if i run it like this ./test.pl no output, but if i run it perl
test.pl it will show me the output

root@server cgi-bin]# ./test.pl
[root@server cgi-bin]# perl test.pl
hello
/var/www/cgi-bin
[root@server cgi-bin]#


if i tried it again and run it under / directory it will run without
any problem


[root@server /]# ./test.pl
hello
/

[root@server /]# perl test.pl
hello
/

[root@server /]#

script content:

[root@server /]# cat test.pl
#!/usr/bin/perl -w
print "hello\n";
print `/bin/pwd` or die "can't run pwd\n";
print "\n";
[root@server /]#


Sent via Archivaty.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com