title: How to add a Path to update-alternatives --config php
body: <p>I'm working on a Ubuntu 16 machine: </p>
  
  <pre><code>lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 16.04.6 LTS
  Release:        16.04
  Codename:       xenial
  </code></pre>
  
  <p>My experience with Ubuntu is "medium".</p>
  
  <p>I needed to change the path the <code>php</code> command refers to in alternatives.
  I did the following: </p>
  
  <pre><code>cd /etc/alternatives
  ls -ls | grep php
  0 lrwxrwxrwx 1 root root  15 Mar  7 06:31 php -&gt; /usr/bin/php7.0
  </code></pre>
  
  <p>I want to change the path <code>/usr/bin/php7.0</code> to <code>/opt/plesk/php/7.2/bin/php</code>.</p>
  
  <p>The first thing I tried is <code>update-alternatives --config php</code>.
  This gave me this: </p>
  
  <p>There is 1 choice for the alternative php (providing /usr/bin/php).</p>
  
  <pre><code>  Selection    Path             Priority   Status
  ------------------------------------------------------------
    0            /usr/bin/php7.0   70        auto mode
  * 1            /usr/bin/php7.0   70        manual mode
  
  Press &lt;enter&gt; to keep the current choice[*], or type selection number:
  </code></pre>
  
  <p>Sadly, I can't add another path by using this command. </p>
  
  <p>The second thing I tried to do is this: <code>update-alternatives --set php /opt/plesk/php/7.2/bin/php</code>. The result of that: </p>
  
  <pre><code>update-alternatives: error: alternative /opt/plesk/php/7.2/bin/php for php not registered; not setting
  </code></pre>
  
  <p>The third attempt, I went to <code>/etc/alternatives</code> and used <code>unlink php</code>. Then I created a new symlink like this: <code>ln -s /opt/plesk/php/7.2/bin/php php</code>.
  This changed the path in alternatives indead. See for yourself: </p>
  
  <pre><code>root@xxtweb03:/etc/alternatives# ls -ls | grep php
  0 lrwxrwxrwx 1 root root  26 Apr  4 12:18 php -&gt; /opt/plesk/php/7.2/bin/php
  </code></pre>
  
  <p>It has only one disadvantage. 
  When I run this command: <code>update-alternatives --config php</code> then the <code>/opt/plesk/php/7.2/bin/php</code> is not among the selection. </p>
  
  <p>This is what I get: </p>
  
  <pre><code>root@xxtweb03:/# update-alternatives --config php
  There is 1 choice for the alternative php (providing /usr/bin/php).
  
    Selection    Path             Priority   Status
  ------------------------------------------------------------
    0            /usr/bin/php7.0   70        auto mode
    1            /usr/bin/php7.0   70        manual mode
  </code></pre>
  
  <p>Question: how can I add <code>/opt/plesk/php/7.2/bin/php</code> to the Path list that is displayed when running <code>update-alternatives --config php</code>?</p>