In /etc/sudoers you will want a line similar to this:
Code:
www-data ALL=NOPASSWD: /usr/bin/vzctl
You will want to make sure that the specifics above are the same for you.
In your PHP code try executing vzctl using sudo
Code:
<?PHP
exec('sudo /usr/bin/vzctl');
?>