Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Check if php installed using perl code

Posted on 2004-08-02
3
Medium Priority
?
210 Views
Last Modified: 2010-03-05
Check if php installed using perl code.

Is it possible to check, using perl, if PHP has been installed and if it is possible to use PHP on this server where I do my test? If so how to check it and is it possible to return "1" of it is possible to run PHP script and "0" if not!
0
Comment
Question by:weversbv
3 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 11698787

isphp {
  foreach my $dir qw(/usr/bin /usr/local/bin) {
    return 1 if -x "$dir/php";
  }

   return 0;
}

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question