From 427427b8fa0f79b4ef9da82b85234aaeaf6d833d Mon Sep 17 00:00:00 2001 From: Murilo Date: Mon, 22 May 2023 21:15:37 -0300 Subject: [PATCH] Adds Ubuntu/Debian native pkgs for newer versions Adds instructions on how to install the newer versions of PHP with native packages for Ubuntu and Debian-based distributions using the repositories maintainened by Ondrej Sury. --- .ruby-version | 1 + _posts/01-06-01-Linux-Setup.md | 68 +++++++++++++++++++ ...=> 01-07-01-Common-Directory-Structure.md} | 0 3 files changed, 69 insertions(+) create mode 100644 .ruby-version create mode 100644 _posts/01-06-01-Linux-Setup.md rename _posts/{01-06-01-Common-Directory-Structure.md => 01-07-01-Common-Directory-Structure.md} (100%) diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..6a81b4c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.8 diff --git a/_posts/01-06-01-Linux-Setup.md b/_posts/01-06-01-Linux-Setup.md new file mode 100644 index 0000000..aac6b73 --- /dev/null +++ b/_posts/01-06-01-Linux-Setup.md @@ -0,0 +1,68 @@ +--- +isChild: true +anchor: linux_setup +--- + +## Linux Setup {#linux_setup_title} + +Most GNU/Linux distributions come with PHP available from the official repositories, but those packages usually are a little behind the current stable version. There are multiple ways to get newer PHP versions on such distributions. On Ubuntu and Debian-based GNU/Linux distributions, for instance, the best alternatives for native packages are provided and maintened by [Ondřej Surý][Ondrej Sury Blog], through his Personal Package Archive (PPA) on Ubuntu and DPA/bikeshed on Debian. Find instructions for each of these below. All that said, you can always use containers, compile the PHP Source code, etc. + +### Ubuntu-based distributions + +For Ubuntu distributions, the [PPA by Ondřej Surý][Ondrej Sury PPA] provides supported PHP versions along with many PECL extensions. To add this PPA to your system, perform the following steps in your terminal: + +1. First, add the PPA to your system's software sources using the command: + + ```bash + sudo add-apt-repository ppa:ondrej/php + ``` + +2. After adding the PPA, update your system's package list: + + ```bash + sudo apt update + ``` + +This will ensure that your system can access and install the latest PHP packages available in the PPA. + +#### Debian-based distributions + +For Debian-based distributions, Ondřej Surý also provides a [bikeshed][bikeshed] (Debian equivalent of a PPA). To add the bikeshed to your system and update it, follow these steps: + +1. Ensure that you have root access. If not, you might need to use `sudo` for the following commands. + +2. Update your system's package list: + + ```bash + sudo apt-get update + ``` + +3. Install `lsb-release`, `ca-certificates`, and `curl`: + + ```bash + sudo apt-get -y install lsb-release ca-certificates curl + ``` + +4. Download the signing key for the repository: + + ```bash + sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg + ``` + +5. Add the repository to your system's software sources: + + ```bash + sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' + ``` + +6. Finally, update your system's package list again: + + ```bash + sudo apt-get update + ``` + +With these steps, your system will be able to install the latest PHP packages from the bikeshed. + +[Ondrej Sury Blog]: https://deb.sury.org/ +[Ondrej Sury PPA]: https://launchpad.net/~ondrej/+archive/ubuntu/php +[bikeshed]: https://packages.sury.org/php/ diff --git a/_posts/01-06-01-Common-Directory-Structure.md b/_posts/01-07-01-Common-Directory-Structure.md similarity index 100% rename from _posts/01-06-01-Common-Directory-Structure.md rename to _posts/01-07-01-Common-Directory-Structure.md