Link to home
Start Free TrialLog in
Avatar of plecostomus
plecostomusFlag for Canada

asked on

PHP Set Variable

I am trying to convert one of my shell scripts to php, but not sure how to set a particular variable. Currently, this is what I have in my shell script:

MYSQL="$(which mysql)"

How can I code this in php?

SOLUTION
Avatar of rogerard
rogerard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of plecostomus

ASKER

I tried the following, but just got this: which mysql
<?php
  $mysql="which mysql";
  echo $mysql;
?>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Excellent.  Good luck!
no objection
This was the one that helped:

<?php

 $mysql = shell_exec('which mysql');
 echo $mysql

?>