I have made a file test.php in (/opt/lampp/htdocs/xampp/test.php)
containing code 

```
$data = shell_exec("sudo php -v"); 
var_dump($data);

```

but it gives me result **NULL**

I am using PHP 5.6.11-1ubuntu3.1 (cli), so i have added line in /etc/sudoers file also

```
www-data ALL=NOPASSWD: /opt/lampp/htdocs/xampp/test.php

```

I have also tried by adding

```
www-data ALL=NOPASSWD: ALL

```

But nothing seems to work. Please help