Well I am doing same as per your instruction, download PHP-REST/client.php and curl.php.
Locally I am accessing with : 'localhost/PHPREST/client.php with below code.. & I am getting result : 1
Moodle side - server1/moodle
I have created a external service - Added function 'core_user_create_users' then mapped all Users.
Next I created new token with External service name, same token I am passing in below code..
Localhost side - localhost/PHPREST/client.php