Instal·lant Composer a FreeBSD 13.2 per a treballar amb Nginx, PHP8.2 i Drupal 10

Composer a FreeBSD 13.2

En aquest xicotet article explique com instal·lar fàcilment Composer a FreeBSD per a treballar amb projectes Drupal dins d'un entorn NGINX a FreeBSD.

Actualment tinc la versió següent de FreeBSD per a Raspberry Pi 4:

# uname -a
FreeBSD mercuri 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC arm64

I la versió de PHP que tinc instal·lat és:

# doas php --version
PHP 8.2.4 (cli) (built: May 11 2023 02:08:56) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies
with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

Si vullguérem saber totes les extensions de PHP que faig servir per als meus projectes de Drupal, farem:

# doas pkg info | grep php
php82-8.2.4 PHP Scripting Language (8.2.X branch)
php82-curl-8.2.4 The curl shared extension for php
php82-dom-8.2.4 The dom shared extension for php
php82-filter-8.2.4 The filter shared extension for php
php82-gd-8.2.4 The gd shared extension for php
php82-mbstring-8.2.4 The mbstring shared extension for php
php82-opcache-8.2.4 The opcache shared extension for php
php82-pdo-8.2.4 The pdo shared extension for php
php82-pdo_mysql-8.2.4 The pdo_mysql shared extension for php
php82-session-8.2.4 The session shared extension for php
php82-simplexml-8.2.4 The simplexml shared extension for php
php82-tokenizer-8.2.4 The tokenizer shared extension for php
php82-xml-8.2.4 The xml shared extension for php
php82-xmlwriter-8.2.7 The xmlwriter shared extension for php
php82-zip-8.2.4 The zip shared extension for php

Doncs bé, anem a instal·lar Composer per a la versió 8.2 de PHP. Primer de tot mirarem les versions disponibles en FreeBSD 13.2 amb:

# doas pkg search composer
php81-composer-2.7.2 Dependency Manager for PHP
php82-composer-2.7.2 Dependency Manager for PHP
php83-composer-2.7.2 Dependency Manager for PHP
subtitlecomposer-0.8.0_1 Advanced FFmpeg-based subtitle editor

Instal·larem Composer de la següent manera (procés complet):

# pkg install php82-composer
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):
.
Installed packages to be UPGRADED:
pkg: 1.19.2 -> 1.21.3
.
Number of packages to be upgraded: 1
.
The process will require 7 MiB more space.
8 MiB to be downloaded.
.
Proceed with this action? [y/N]: y
[1/1] Fetching pkg-1.21.3.pkg: 100% 8 MiB 8.5MB/s 00:01
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.19.2 to 1.21.3...
[1/1] Extracting pkg-1.21.3: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100% 178 B 0.2kB/s 00:01
Fetching data.pkg: 100% 7 MiB 7.0MB/s 00:01
Processing entries: 100%
FreeBSD repository update completed. 32898 packages processed.
All repositories are up to date.
The following 7 package(s) will be affected (of 0 checked):
.
New packages to be INSTALLED:
php82-composer: 2.7.2
php82-ctype: 8.2.18
php82-intl: 8.2.18
php82-phar: 8.2.18
.
Installed packages to be UPGRADED:
boost-libs: 1.81.0 -> 1.84.0
galera26: 26.4.14 -> 26.4.16_2
icu: 72.1,1 -> 74.2_1,1
.
Number of packages to be installed: 4
Number of packages to be upgraded: 3
.
The process will require 3 MiB more space.
26 MiB to be downloaded.
.
Proceed with this action? [y/N]: y
[1/7] Fetching galera26-26.4.16_2.pkg: 100% 701 KiB 718.2kB/s 00:01
[2/7] Fetching boost-libs-1.84.0.pkg: 100% 13 MiB 14.2MB/s 00:01
[3/7] Fetching php82-composer-2.7.2.pkg: 100% 530 KiB 543.2kB/s 00:01
[4/7] Fetching php82-intl-8.2.18.pkg: 100% 129 KiB 131.8kB/s 00:01
[5/7] Fetching icu-74.2_1,1.pkg: 100% 11 MiB 11.2MB/s 00:01
[6/7] Fetching php82-ctype-8.2.18.pkg: 100% 7 KiB 6.8kB/s 00:01
[7/7] Fetching php82-phar-8.2.18.pkg: 100% 96 KiB 98.4kB/s 00:01
Checking integrity... done (0 conflicting)
[1/7] Upgrading icu from 72.1,1 to 74.2_1,1...
[1/7] Extracting icu-74.2_1,1: 100%
[2/7] Upgrading boost-libs from 1.81.0 to 1.84.0...
[2/7] Extracting boost-libs-1.84.0: 100%
[3/7] Installing php82-intl-8.2.18...
[3/7] Extracting php82-intl-8.2.18: 100%
[4/7] Installing php82-ctype-8.2.18...
[4/7] Extracting php82-ctype-8.2.18: 100%
[5/7] Installing php82-phar-8.2.18...
[5/7] Extracting php82-phar-8.2.18: 100%
[6/7] Upgrading galera26 from 26.4.14 to 26.4.16_2...
[6/7] Extracting galera26-26.4.16_2: 100%
[7/7] Installing php82-composer-2.7.2...
[7/7] Extracting php82-composer-2.7.2: 100%
=====
Message from php82-intl-8.2.18:
.
--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-intl.ini.sample
=====
Message from php82-ctype-8.2.18:
.
--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-ctype.ini.sample
=====
Message from php82-phar-8.2.18:
.
--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-phar.ini.sample

I ja ho tenim instal·lat. El procès ha durat 4 minuts ací a la Raspberry Pi, tal vegada si tens un servidor més potent el procès serà més ràpid.

ALTRES ARTICLES PUBLICATS A LA MEUA WEB:
- Composer i PHP 7.2 a OpenBSD
- Instal·lar el gestor de dependències Composer a un servidor dedicat de 1AND1 IONOS

Doncs bé això és tot, espere que trobes útil aquest article i que et motive a compartir els teus trucs, els teus coneixements i els teus experiments amb el Programari Lliure. Pensa-ho, va, que la Comunitat del Programari Lliure va creixent gràcies a la documentació, el disseny, la formació o la programació, sigues part de la Comunitat :-)

La cultura i la lliure circulació de les idees és l'arma més efectiva contra les dictadures del pensament i contra la ignorància.

Utilitats

NAVEGACIÓ SENSE RATOLÍ

- Tab següent enllaç.
- Shift+Tab anterior enllaç.
- Enter activa l'enllaç.
- Alt+esquerra anar arrere.

CONTRAST DE COLORS

Accessibilitat - Color Negre
Accessibilitat - Color Groc
Accessibilitat - Color Verd

Accessibilitat - Color Blau
Accessibilitat - Color Crema
Accessibilitat - Color Blanc

 

PORTADES ALTERNATIVES