Below is the command I tried executing, without success:
exec(\'ln -s \' . PLUGIN_DIR . \'/.htaccess \' . ABSPATH . \'/.htaccess\');
When y
This worked for me in several scenarios:
ob_start(); exec($cmd . " 2>&1", $output); $result = ob_get_contents(); ob_end_clean(); var_dump($output);
The space between " 2 is important