Take this example, does this load the echo if say for example php exec is enabled and I can run this command: /etc/init.d/mysql restart
or would I need to set !== false
to !== true
?
$var = exec('/etc/init.d/mysql restart');
if ($var !== false) {
echo "php exec is enabled";
}
Basically what I am trying to do is, restart mysql from php if this function is enabled on the server
$var = exec('/etc/init.d/mysql restart');
if ($var !== false) {
exec('/etc/init.d/mysql restart');
echo "php exec is enabled and restart mysql";
}