I tried this in php but it is giving me error of can't execute... Maybe if I do it in bash code it will work more smoothly???
This is the php script:
<?php
$link = mysql_connect('dev2.wiley.com', 'root', 'pass');
if (!$link) {
mail('name@place.com', 'Server Down', 'MySQL Server on dev Down');
die();
}
mysql_close($link);
?>
This is the error I get:
/opt/mysql/
bash-2.05# ./emailServerDown.php
bash: ./emailServerDown.php: Permission denied
bash-2.05# su mysql
$ ./emailServerDown.php
./emailServerDown.php: cannot execute
This is the php script:
<?php
$link = mysql_connect('dev2.wiley.com', 'root', 'pass');
if (!$link) {
mail('name@place.com', 'Server Down', 'MySQL Server on dev Down');
die();
}
mysql_close($link);
?>
This is the error I get:
/opt/mysql/
bash-2.05# ./emailServerDown.php
bash: ./emailServerDown.php: Permission denied
bash-2.05# su mysql
$ ./emailServerDown.php
./emailServerDown.php: cannot execute