Attention to all PHP Guru's out there ,

Before pulling all hair out of my head i've decided to turn to the forum that has been so good too me.

I've set up a web interface ( running apache ) that needs to fire up wvdial and perform some tests . The php command : -

$dial = shell_exec['wvdial --config /usr/local/webroot/dialup_scripts/$pop'];
//sleep to give wvdial time to run
shell_exec('sleep 5');
echo $dial;

The code is executed but i get the returned result back to the browser :

--> WvDial Internet Dialler version 1.53
--> Cannot open /dev/modem : Device or Resource busy
--> Cannot open /dev/modem : Device or Resource busy
--> Cannot open /dev/modem : Device or Resource busy

So the coding is fine, i'm thinking that maybe this is a permissions problem
so i added 'sudo' to the code mix . Editted to sudoers file through visudo
and added :

# User privilege specification
root ALL=(ALL) ALL
apache ALL=(ALL) ALL

Changed the php code slightly to :

shell_exec['sudo wvdial --config /usr/local/webroot/dialup_scripts/$pop'];

Still no joy though and getting the same results echoed to the browser.

NB : - if i run wvdial --config /usr/local/webroot/dialup_scripts/$pop' from the command line it works successfully.

Any help will be greatly appreciated.

regards
./ronald