skip to Main Content

Ubuntu 18.04. Nginx.

The server used to be hosted by Laravel Forge. Now – no, in free swimming. There were no changes on the server – everything that was created and configured by Forge remained.

I see the PHP 8.1 version is installed along the path /usr/bin/*php8.1. How can I change the php version now? Directly on the server without the Forge web interface. Thanks.

2

Answers


  1. Go to your server and click PHP from the menu on the left. Scroll down on the page and click “Install” on the desired version.
    Here is complete way if you wantenter link description here

    Login or Signup to reply.
  2. In Terminal

    sudo update-alternatives --config php 
    

    will display all versions installed, choose a number selection if you want a version

    There are 3 choices for the alternative php (providing /usr/bin/php).
    
      Selection    Path             Priority   Status
    ------------------------------------------------------------
    * 0            /usr/bin/php8.0   80        auto mode
      1            /usr/bin/php7.2   72        manual mode
      2            /usr/bin/php7.4   74        manual mode
      3            /usr/bin/php8.0   80        manual mode
    
    Press "enter" to keep the current choice[*], or type selection number: 2
    update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in manual mode
    

    check current php version

    php --version
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search