Topic: TTY errors

Hey guys, what's up? I have a problem when using #! for some PHP development. I have xampp (lampp) installed for my development setup, and when I use the exec function in PHP to do an operation with sudo:

<?php 
 exec ('echo "mypass" | sudo -S mkdir /etc/some/dir');
?>

I get an error in my apache logs and the exec isn't executed.

The error is:

sudo: no tty present and no askpass program specified

However, this issue isn't present when I use the same script in Ubuntu. I was just wondering what this means and how it can be resolved. I've googled the error, but all it says is that I'm not using the correct password, which i am.