Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Getting Apache Version

by ultranerds (Hermit)
on Nov 06, 2008 at 09:59 UTC ( #721931=note: print w/replies, xml ) Need Help??


in reply to Re: Getting Apache Version
in thread Getting Apache Version

Damn it - won't work :(
#!/usr/bin/perl # example paths can be: # apachectl # apache2ctl # httpd my $path = 'httpd'; print "Content-Type: text/html \n\n"; print "Perl: " . $] . "<br />"; my $output = `$path -v`; my $output2 = system(qq|$path -v|); print "OUTPUT: ($path -v) " . $output . "<br />"; print "OUTPUT 2: ($path -v, as system()) " . $output2 . "<br />"; my @split = split /:/, $output; if ($split[1] !~ /\d\.\d\.\d/) { print qq|Cant find Apache version <br />|; } else { print qq|$split[1] <br />|; }
..yet all that gives is:
Perl: 5.008004 OUTPUT: (httpd -v) OUTPUT 2: (httpd -v, as system()) -1 Cant find Apache version
Seems that it doesn't like giving the results with `` or system(). Any suggestions? TIA Andy

Replies are listed 'Best First'.
Re^3: Getting Apache Version
by ultranerds (Hermit) on Nov 06, 2008 at 15:22 UTC
    Anyone got any suggestions? :/

    Cheers

    Andy
      I don't see where you check error messages, or check that httpd is in the path and readable and executable by current user

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://721931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-10-20 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?