$schemamarkup = get_post_meta(get_the_ID(), 'schemamarkup', true); if(!empty($schemamarkup)) { echo $schemamarkup; }

LAMP PHP 8.x Installation in Linux Mint – Step-by-step

November 25, 2021 | By the+gnu+linux+evangelist.

Installing

  1. 3. Installing LAMP

    To install LAMP PHP 8.x on Linux Mint, run the following command for the default setup:

    sudo apt install apache2 php8.x mysql-server mysql-client php8.x-mysql

    Alternatively, replace MySQL with MariaDB:

    Enable MariaDB Repo for Mint

    Search for the latest PHP 8 release:

    apt search php8.

    Install with:

    sudo apt install apache2 php8.x mariadb-server mariadb-client php8.x-mysql

    Verify PHP installation with:

    php -v
  2. 4. Searching PHP 8.x Extensions

    Search for available PHP 8.x extensions:

    sudo apt search php8.x

    Refine results using grep:

    sudo apt search php8.x | grep [KEYWORD]

    Install useful modules for WordPress:

    sudo apt install php8.x-imagick php8.x-curl php8.x-gd php8.x-mbstring php8.x-xml php8.x-xmlrpc php8.x-soap php8.x-intl php8.x-zip
    Apt PHP 8 Search Results

    To install multiple packages at once:

    sudo apt install php8.x-{curl,xml,imagick,mysql,fpm,bz2}
  3. 5. Testing LAMP

    To test your LAMP web server installation, access the server’s document root:

    cd /var/www/html

    Create a PHP info file:

    sudo nano info.php

    For sudo issues, refer to: Enable sudo
    Add the following code:

    <?php
    phpinfo();
    ?>

    Ctrl+x to save and exit nano.

    Set www-data as the owner of the web server directory:

    sudo chown -R www-data:www-data /var/www

    Then open your browser at:
    http://localhost/info.php
    PHP Info Test

    You should see the PHP info page successfully.

    For creating an Apache 2 Virtual Host, see: GNU+Linux Apache2 VHost

    GNU/Linux Apache2 Virtual-Host Quick Start

Contents