Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lde-for-ubuntu [2025/12/08 08:29] – kkaragoz | lde-for-ubuntu [2025/12/08 09:48] (current) – [Installing PHP and Required Modules] kkaragoz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Installing | + | ===== Installing |
| + | This step installs essential utilities needed for subsequent installations. | ||
| <code bash> | <code bash> | ||
| - | sudo apt install zip unzip software-properties-common | + | sudo apt update && sudo apt upgrade -y |
| + | sudo apt install zip unzip software-properties-common | ||
| </ | </ | ||
| - | ===== PHP installation | + | ===== PHP Installation (Specified: PHP 8.4) ===== |
| - | Installing PHP's versions and libraries are pretty easy with the Ondrej Sury's personal package archive (PPA). I will install | + | The **Ondrej Sury PPA** is used for installing and managing PHP versions. We will target **PHP 8.4** as specified. You can check the available versions and their support status on the official PPA page: [[https:// |
| ==== Adding Repository ==== | ==== Adding Repository ==== | ||
| + | The PPA must be added to your system' | ||
| <code bash> | <code bash> | ||
| - | sudo add-apt-repository ppa: | + | sudo add-apt-repository ppa: |
| + | sudo apt update | ||
| </ | </ | ||
| - | After adding | + | ==== Installing PHP and Required Modules ==== |
| + | |||
| + | DokuWiki requires specific PHP modules (extensions). The following command installs PHP 8.4 alongside | ||
| <code bash> | <code bash> | ||
| - | sudo apt update | + | sudo apt install -y php8.4 php8.4-fpm php8.4-cli php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip php8.4-intl php8.4-pdo php8.4-mysql |
| + | |||
| </ | </ | ||
| - | ==== Installing PHP ==== | + | <WRAP center round info 60%> |
| + | **Note:** We include **php-fpm** for use with high-performance web servers like **Nginx** or **Apache** via **mod_fcgid** or **mod_proxy_fcgi**. If you encounter issues, ensure `php8.4` is available in the PPA at the time of installation, | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== MariaDB Server Installation ===== | ||
| + | MariaDB is the recommended drop-in replacement for MySQL. | ||
| + | |||
| + | ==== Installation | ||
| <code bash> | <code bash> | ||
| - | sudo apt install -y php8.4 php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip php8.4-intl | + | sudo apt install |
| + | sudo systemctl start mariadb | ||
| + | sudo systemctl enable mariadb | ||
| </ | </ | ||
| - | ===== MySQL or MariaDB ===== | + | ==== Initial Security Setup ==== |
| + | Then, secure the installation by running the following script. **Execute all steps carefully.** | ||
| <code bash> | <code bash> | ||
| - | sudo apt install mariadb-server | + | sudo mysql_secure_installation |
| </ | </ | ||
| - | Then we can start the installation | + | * **1- Enter current password for root (enter for none):** |
| + | * **Action:** Press **ENTER** (the root MariaDB user has no password | ||
| + | |||
| + | * **2- Switch to unix_socket authentication [Y/n]:** | ||
| + | * **Action:** Type **n**. We will set a password instead. | ||
| + | |||
| + | * **3- Change the root password? [Y/n]:** | ||
| + | * **Action:** Type **Y** and set a strong password. | ||
| + | * RESPONSE: | ||
| + | - New password: SET A STRONG PASS | ||
| + | - Re-enter new password: RE-ENTER PASS | ||
| + | |||
| + | * **4- Remove anonymous users? [Y/n]:** | ||
| + | * **Action:** Type **Y**. Anonymous users are a security risk. | ||
| + | |||
| + | * **5- Disallow root login remotely? [Y/n]:** | ||
| + | * **Action:** Type **Y**. **Highly Recommended** for security unless absolutely required. | ||
| + | |||
| + | * **6 - Remove test database and access to it? [Y/n]:** | ||
| + | * **Action:** Type **Y**. | ||
| + | |||
| + | * **7 - Reload privilege tables now? [Y/n]:** | ||
| + | * **Action:** Type **Y**. This applies the changes immediately. | ||
| + | ==== MariaDB Service Status ==== | ||
| + | When installed from the default repositories, | ||
| <code bash> | <code bash> | ||
| - | sudo mysql_secure_installation | + | sudo systemctl status mariadb |
| </ | </ | ||
| - | Installation script will ask some questions: | + | You should see a similar output as following one: |
| - | 1- Enter current password for root (enter for none): | + | <code bash> |
| - | JUST PRESS ENTER | + | ● mariadb.service |
| - | RESPONSE: | + | |
| - | OK, successfully used password, moving on... | + | |
| + | Docs: man: | ||
| + | https:// | ||
| + | Main PID: 13685 (mariadbd) | ||
| + | | ||
| + | Tasks: 11 (limit: 244840) | ||
| + | | ||
| + | CPU: 640ms | ||
| + | | ||
| + | | ||
| + | </ | ||
| - | 2- You already have your root account protected, so you can safely answer ' | + | ==== Testing MariaDB ==== |
| - | Switch to unix_socket authentication [Y/n] n | + | <code bash> |
| - | Type ' | + | mysql -u root -pTypeThePasswordThatYouSet |
| - | RESPONSE: | + | </code> |
| - | ... skipping. | + | |
| - | 3- You already have your root account protected, so you can safely answer ' | + | If the installation successfully happened, you should see the following message: |
| + | <code bash> | ||
| + | user@domain: | ||
| + | Welcome to the MariaDB monitor. | ||
| + | Your MariaDB connection id is 38 | ||
| + | Server version: 10.11.13-MariaDB-0ubuntu0.24.04.1 Ubuntu 24.04 | ||
| - | Change the root password? [Y/n] Y | + | Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. |
| - | TYPE ' | + | |
| - | RESPONSE 1: | + | |
| - | New password: <ENTER YOU PASS> | + | |
| - | Re-enter new password: <REENTER YOU PASS> | + | |
| - | RESPONSE 2: | + | |
| - | Password updated successfully! | + | |
| - | Reloading privilege tables.. | + | |
| - | ... Success! | + | |
| - | 4- Remove anonymous users? [Y/n] y | + | Type ' |
| - | ... Success! | + | |
| + | MariaDB [(none)]> | ||
| + | </ | ||
| - | 5- Disallow root login remotely? [Y/n] n | ||
| - | THIS IS TOTALLY PERSONAL DECISION | ||
| - | RESPOSNE: | ||
| - | ... skipping. | ||
| - | 6 - Remove test database and access to it? [Y/n] Y | + | You can just type the following command for exit the MySQL console: |
| + | <code mysql> | ||
| + | MariaDB | ||
| + | </ | ||
| - | RESPONSE: | + | If MariaDB is not running, you can start the service by following command: |
| - | - Dropping test database... | + | <code bash> |
| - | ... Success! | + | sudo systemctl start mariadb |
| - | - Removing privileges on test database... | + | </ |
| - | ... Success! | + | and also enable the service by: |
| + | <code bash> | ||
| + | sudo systemctl enable mariadb | ||
| + | </ | ||
| - | 7 - Reload privilege tables now? [Y/n] Y | + | For and additional check, you can run the following command: |
| - | ... Success! | + | <code bash> |
| - | RESPONSE: | + | sudo mysqladmin version |
| - | Cleaning up... | + | </ |
| + | You should receive a response like: | ||
| + | <code bash> | ||
| + | mysqladmin | ||
| + | Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. | ||
| + | Server version | ||
| + | Protocol version | ||
| + | Connection | ||
| + | UNIX socket | ||
| + | Uptime: | ||
| + | Threads: 1 Questions: 74 Slow queries: 0 Opens: 33 Open tables: 26 Queries per second avg: 0.031 | ||
| + | </ | ||
| + | |||
| + | ===== Composer Installation ===== | ||
| + | Composer has an awesome description and installation guide on its webpage. You can use the following link: [[https:// | ||
| + | |||
| + | It is better to go your home directory first: | ||
| + | <code bash> | ||
| + | cd ~ | ||
| + | </ | ||
| + | |||
| + | == 1. Download the terminal script == | ||
| + | <code bash> | ||
| + | php -r " | ||
| + | </ | ||
| + | |||
| + | == 2. Check the hash file == | ||
| + | <code bash> | ||
| + | php -r "if (hash_file(' | ||
| + | </ | ||
| + | It should return the following message: **Installer verified** | ||
| + | == 3. Run the Script == | ||
| + | <code bash> | ||
| + | php composer-setup.php | ||
| + | </ | ||
| + | |||
| + | It should return the following message: | ||
| + | |||
| + | <code bash> | ||
| + | All settings correct for using Composer | ||
| + | Downloading... | ||
| + | |||
| + | Composer (version 2.9.2) successfully installed to: / | ||
| + | Use it: php composer.phar | ||
| + | </ | ||
| + | |||
| + | |||
| + | == 4. Delete (Unlink) the File == | ||
| + | <code bash> | ||
| + | php -r " | ||
| + | </ | ||
| + | |||
| + | == 5. Add it to the PATH == | ||
| + | Then you can add the composer into your PATH to access the composer with just running `composer` command from any directory: | ||
| + | <code bash> | ||
| + | sudo mv composer.phar / | ||
| + | </ | ||
| + | |||
| + | == 6. Test the Installation == | ||
| + | <code bash> | ||
| + | composer --version | ||
| + | </ | ||
| + | |||
| + | You need to see something similar like: | ||
| + | <code bash> | ||
| + | Composer version 2.9.2 2025-11-19 21:57:25 | ||
| + | PHP version 8.4.15 (/ | ||
| + | Run the " | ||
| + | </ | ||
