0

Basically I'd like to know of a very simple method for making a php script check if a specific program is running on my nix box.

Something like :

<?php

#some detection function here.

if($detectprogram == 1){ 
echo("It's running.");
}
else{
echo("It's not running.");
}
?>

Or even if I had to execute the program via a .sh (as I already do) and an -outputphp /path/to/htdocs/. Or similar. Thanks.

1 Answer 1

0

Maybe you need this?

exec("ps auxwww|grep sample.php|grep -v grep", $output);

Source: How to get list of running php scripts using PHP exec()?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.