EDIT: Problem isn't with PHP, I was using cURL wrong. Updated question to show problem I'm having with XHR.
Summary: Can't get username to PHP using XHR:
var xhr = Ti.Network.createHTTPClient();
xhr.timeout = 1000000;
xhr.open("GET","http://myapi.com/test", false, 'user', 'pass');
xhr.send();
And in my PHP script, I'm trying to access the username with this:
<?php print $_SERVER['PHP_AUTH_USER']; ?>
No matter what I try it's always empty.
Is there some PHP setting that I need to configure?
More info: PHP Version 5.2.13, Apache, MAMP
$_SERVER['HTTP_AUTHORIZATION']
is being set? – Oxygen