Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 12651

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Accessing FTP(s) URLs</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="wrappers.http.html">http://</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="wrappers.php.html">php://</a></div>
 <div class="up"><a href="wrappers.html">Supported Protocols and Wrappers</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="wrappers.ftp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ftp://</h1>
  <h1 class="refname">ftps://</h1>
  <p class="refpurpose"><span class="refname">ftp://</span> -- <span class="refname">ftps://</span> &mdash; <span class="dc-title">Accessing FTP(s) URLs</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-wrappers.ftp-description">
  <h3 class="title">Description</h3>
  <p class="para">
   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.
  </p>
  <p class="simpara">
   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 <em>overwrite</em>, the connection
   will fail.  If you need to overwrite existing files over ftp,
   specify the <em>overwrite</em> option in the context
   and open the file for writing.  Alternatively, you can
   use the <a href="ref.ftp.html" class="link">FTP extension</a>.
  </p>
  <p class="simpara">
   If you have set the <a href="filesystem.configuration.html#ini.from" class="link">from</a> directive
   in <var class="filename">php.ini</var>, then this value will be sent as the anonymous FTP
   password.
  </p>
 </div>


 <div class="refsect1 usage" id="refsect1-wrappers.ftp-usage"> 
  <h3 class="title">Usage</h3>
  <ul class="itemizedlist">
   <li class="listitem"><span class="simpara"><var class="filename">ftp://example.com/pub/file.txt</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">ftp://user:password@example.com/pub/file.txt</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">ftps://example.com/pub/file.txt</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">ftps://user:password@example.com/pub/file.txt</var></span></li>
  </ul>
 </div>
 

 <div class="refsect1 options" id="refsect1-wrappers.ftp-options">
  <h3 class="title">Options</h3>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Wrapper Summary</strong></caption>
    
     <thead>
      <tr>
       <th>Attribute</th>
       <th>PHP 4</th>
       <th>PHP 5</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>Restricted by <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a></td>
       <td>Yes</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Reading</td>
       <td>Yes</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Writing</td>
       <td>Yes (new files only)</td>
       <td>Yes (new files/existing files with <em><code class="parameter">overwrite</code></em>)</td>
      </tr>

      <tr>
       <td>Allows Appending</td>
       <td>No</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Simultaneous Reading and Writing</td>
       <td>No</td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports  <span class="function"><a href="function.stat.html" class="function">stat()</a></span></td>
       <td>No</td>
       <td>
        As of PHP 5.0.0:  <span class="function"><a href="function.filesize.html" class="function">filesize()</a></span>,
         <span class="function"><a href="function.filetype.html" class="function">filetype()</a></span>,  <span class="function"><a href="function.file-exists.html" class="function">file_exists()</a></span>,
         <span class="function"><a href="function.is-file.html" class="function">is_file()</a></span>, and  <span class="function"><a href="function.is-dir.html" class="function">is_dir()</a></span> elements only.
        As of PHP 5.1.0:  <span class="function"><a href="function.filemtime.html" class="function">filemtime()</a></span>.
       </td>
      </tr>

      <tr>
       <td>Supports  <span class="function"><a href="function.unlink.html" class="function">unlink()</a></span></td>
       <td>No</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Supports  <span class="function"><a href="function.rename.html" class="function">rename()</a></span></td>
       <td>No</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Supports  <span class="function"><a href="function.mkdir.html" class="function">mkdir()</a></span></td>
       <td>No</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Supports  <span class="function"><a href="function.rmdir.html" class="function">rmdir()</a></span></td>
       <td>No</td>
       <td>Yes</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>
 

 <div class="refsect1 changelog" id="refsect1-wrappers.ftp-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.3.0</td>
       <td>
        Added <em>ftps://</em>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-wrappers.ftp-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    FTPS is only supported when the <a href="book.openssl.html" class="link">openssl</a>
    extension is enabled.
   </p>
   <span class="simpara">
    If the server does not support SSL, then the connection falls back
    to regular unencrypted ftp.
   </span>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>Appending</strong><br />
   <span class="simpara">
    As of PHP 5.0.0 files may be appended via the
    <em>ftp://</em> URL wrapper.  In prior versions, attempting
    to append to a file via <em>ftp://</em> will result in failure.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-wrappers.ftp-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li class="member"><a href="context.ftp.html" class="xref">FTP context options</a></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="wrappers.http.html">http://</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="wrappers.php.html">php://</a></div>
 <div class="up"><a href="wrappers.html">Supported Protocols and Wrappers</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>