title: How to set `uidNumber` Unique and Auto Increment for Posix Account Creation in OpenLDAP via PHP?
body: <p>According to <a href="http://www.linfo.org/uid.html" rel="nofollow">this</a>, I know that :</p>
  
  <blockquote>
    <p>A user ID (UID) is a unique positive integer assigned by a Unix-like operating system to each user. Each user is identified to the system by its UID.</p>
  </blockquote>
  
  <p>When we create a <strong>Posix Account</strong> user via PHP, we need to set up the <code>uidNumber</code> like the following.</p>
  
  <pre><code>$info['uidNumber'] = 1234;
  </code></pre>
  
  <p>However, we cannot preset or predict the value since it is unique and we need to change it according to the actual existence of the user who uses the ID. So, can we set this value <code>auto increment</code> and <code>unique</code> in the OpenLDAP system? Or, we should do the <code>auto increment</code> and <code>unique check</code> in PHP logics?</p>
  
  <hr>
  
  <h3>UPDATE 1</h3>
  
  <p>After several tests, I found that <code>uidNumber</code> must be unique under the same parent DN. If we try to add a new object with a <code>uidNumber</code> already used under the same parent DN, it will give an error.</p>
  
  <p>So, now the problem becomes how to make it <strong>auto increment</strong>? </p>