Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 4391

php-manual-en-7.2.11-1.mga7.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>Changes user ownership of symlink</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.lchgrp.html">lchgrp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.link.html">link</a></div>
 <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.lchown" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">lchown</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PHP 7)</p><p class="refpurpose"><span class="refname">lchown</span> &mdash; <span class="dc-title">Changes user ownership of symlink</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.lchown-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>lchown</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$user</code></span>
   )</div>

  <p class="para rdfs-comment">
   Attempts to change the owner of the symlink <code class="parameter">filename</code>
   to user <code class="parameter">user</code>.
  </p>
  <p class="para">
   Only the superuser may change the owner of a symlink.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.lchown-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
       Path to the file.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">user</code></dt>

     <dd>

      <p class="para">
       User name or number.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.lchown-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.lchown-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-2907">
    <p><strong>Example #1 Changing the owner of a symbolic link</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$target&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'output.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'output.html'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">symlink</span><span style="color: #007700">(</span><span style="color: #0000BB">$target</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">lchown</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.lchown-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">This function will not work on
<a href="features.remote-files.html" class="link">remote files</a> as the file to
be examined must be accessible via the server&#039;s filesystem.</span></p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">When <a href="features.safe-mode.html" class="link">safe mode</a> is enabled, PHP checks whether
the files or directories being operated upon have the same UID (owner) as the
script that is being executed.</span></p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">This function is not
implemented on Windows platforms.</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.lchown-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.chown.html" class="function" rel="rdfs-seeAlso">chown()</a> - Changes file owner</span></li>
    <li class="member"><span class="function"><a href="function.lchgrp.html" class="function" rel="rdfs-seeAlso">lchgrp()</a> - Changes group ownership of symlink</span></li>
    <li class="member"><span class="function"><a href="function.chgrp.html" class="function" rel="rdfs-seeAlso">chgrp()</a> - Changes file group</span></li>
    <li class="member"><span class="function"><a href="function.chmod.html" class="function" rel="rdfs-seeAlso">chmod()</a> - Changes file mode</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.lchgrp.html">lchgrp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.link.html">link</a></div>
 <div class="up"><a href="ref.filesystem.html">Filesystem Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>