PHP Supported Protocols and Wrappers
ADVERTISEMENTS
In PHP There are many built-in wrappers for various URL-style protocols for use with the filesystem functions such as fopen(), copy(), file_exists() and filesize().
In addition to these wrappers, it is possible to register custom wrappers using the stream_wrapper_register() function.
Note: The syntax of the URL used to describe a wrapper only supports the
scheme://... syntax
. The scheme:/
and scheme:
syntaxes are not supported.
Supported Protocols in PHP
- file:// — Accessing local filesystem
- http:// — Accessing HTTP(s) URLs
- ftp:// — Accessing FTP(s) URLs
- php:// — Accessing various I/O streams
- zlib:// — Compression Streams
- data:// — Data (RFC 2397)
- glob:// — Find pathnames matching pattern
- phar:// — PHP Archive
- ssh2:// — Secure Shell 2
- rar:// — RAR
- ogg:// — Audio streams
- expect:// — Process Interaction Streams