HTTP context options

HTTP context option listing Context options for http:// and https:// transports. Changelog: 5.3.4 Added follow_location. 5.3.0 The protocol_version supports chunked transfer decoding when set to 1.1. 5.2.10 Added ignore_errors. 5.2.10 The header can now be an numerically indexed array. 5.2.1 Added timeout.

FTP context options

FTP context option listing Context options for ftp:// and ftps:// transports. Changelog: 5.1.0 Added proxy. 5.0.0 Added overwrite and resume_pos. Notes: Underlying socket stream context options Additional context options may be supported by the underlying transport For ftp:// streams, refer to context options for the tcp:// transport. For ft

SSL context options

SSL context option listing Context options for ssl:// and tls:// transports. Changelog: 5.6.0 Added peer_fingerprint and verify_peer_name. verify_peer default changed to TRUE. 5.4.13 Added disable_compression. Requires OpenSSL >= 1.0.0. 5.3.2 Added SNI_enabled and SNI_server_name. 5.0.0 Added capture_peer_cert, capture_peer_chain

CURL context options

CURL context option listing CURL context options are available when the CURL extension was compiled using the --with-curlwrappers configure option. Examples: Fetch a page and send POST data <?php $postdata = http_build_query(     array(         'var1' => 'some content',         'var2' => 'doh'     ) ); $opts = array('http' =>     array(         'method'  => 'PO

Phar context options

Phar context option listing Context options for phar:// wrapper. See also: phar:// - Phar stream wrapper -

MongoDB context options

MongoDB context option listing Context options for mongodb:// transports. Changelog: pecl/mongo 1.5.0 Added Write API Context options See also: Socket context options - SSL context options -

Context parameters

Context parameter listing These parameters can be set on a context using the stream_context_set_params() function.

file://

Accessing local filesystem Filesystem is the default wrapper used with PHP and represents the local filesystem. When a relative path is specified (a path which does not begin with /, \, \\, or a Windows drive letter) the path provided will be applied against the current working directory. In many cases this is the directory in which the script resides unless it has been changed. Using the CLI sapi, this defaults to the directory from which the script was called.

http://

Accessing HTTP(s) URLs Allows read-only access to files/resources via HTTP 1.0, using the HTTP GET method. A Host: header is sent with the request to handle name-based virtual hosts. If you have configured a user_agent string using your php.ini file or the stream context, it will also be included in the request. The stream allows access to the body of the resource; the headers are stored in the $http_response_header variable. If it's important to know the URL

ftp://

Accessing FTP(s) URLs Allows read access to existing files and creation of new files via FTP. If the server does not support passive mode ftp, the connection will fail. You can open files for either reading or writing, but not both simultaneously. If the remote file already exists on the ftp server and you attempt to open it for writing but have not specified the context option overwrite, the connection will fail. If you need to overwrite existing files over ft