以另一个用户身份从php运行bash脚本

I would like to run a bash script without opening a terminal in my Ubuntu system. Some other users will have to daily check and run that process. So I thought I could build a simple php website that could run the script. After some reading here at Stack Overflow and googleing I thought shell_exec could do the trick. But as I don't want to give permissions in some directories to www-data I want to run the scripts as the owner, user meteo.

This is my php:

$autput = shell_exec('date +%d/%m/%Y-%H:%m');
echo "<pre>Hora de inicio: $autput</pre>";

$output = shell_exec('/home/meteo/RAMS/SCRIPTS/RAMS_operatiu.bash');
echo "<pre>".$output."</pre>";

The content of sudoers file, sudo visudo

meteo   ALL = NOPASSWD: /home/meteo/RAMS/SCRIPTS/RAMS_operatiu.bash
www-data   ALL = NOPASSWD: /home/meteo/RAMS/SCRIPTS/RAMS_operatiu.bash

This way, www-data user runs my script (RAMS_operatiu.bash) but as this script runs an mpich job it has to check mpd.conf then the script crashes as there is not such file for www-data. It actually exists for meteo. So I would like to run as meteo better than www-data. I tried to use

$output = shell_exec('sudo -u meteo /home/meteo/www/RAMS/inicio_RAMS.sh');

but can't find the point to tell the php script to run as meteo, not www-data. Is this possible? Probably I am missing something.

Thank you very much for your help.