The behaviour of these functions is affected by settings in php.ini.
Here's a short explanation of the configuration directives.
The host to which to connect.
The virtual host to which to connect on the host.
The port on which to connect.
The login (username) used for authenticating against the host.
The password used for authenticating against the host.