The following is a list of the various URL style protocols that PHP has built-in for use with the filesystem functions such as fopen() and copy(). In addition to these wrappers, as of PHP 4.3, you can write your own wrappers using PHP script and file_register_wrapper().
Table I-1. URL Wrappers
Protocol | Versions | Description |
---|---|---|
http:// | All | Allows read-only access to files/resources via HTTP. |
https:// | PHP 4.3 and up, with SSL support | Allows read-only access to files/resources via SSL secured HTTP. |
ftp:// | All | Allows read access to existing files and creation of new files via FTP. |
ftps:// | PHP 4.3 and up, with SSL support | The same as ftp://, but uses SSL when supported by the FTP server. |
php://stdin | PHP 3.0.13 and up | Allows read acess to the standard input stream of the PHP process. |
php://stdout | PHP 3.0.13 and up | Allows write acess to the standard output stream of the PHP process. |
php://stderr | PHP 3.0.13 and up | Allows write acess to the standard error stream of the PHP process. |
php://output | PHP 4.3 and up | Allows write acess to the output buffer mechanism, just like echo() and print(). |
zlib: | PHP 4.0.4 - PHP 4.2.3, systems with fopencookie only | Works like gzopen(), except that the stream can be used with fread() and the other filesystem functions. This is deprecated as of PHP 4.3 due to ambiguities with filenames containing ':' characters; use compress.zlib:// instead. |
compress.zlib:// | PHP 4.3 and up | Works just like gzopen(), even on systems without fopencookie. |
compress.bzip2:// | PHP 4.3 and up | Works just like bzopen(). |