Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Getting Apache Version

by ultranerds (Hermit)
on Nov 06, 2008 at 09:59 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://721931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found