Utilisation des paquets

Il existe quelques versions pré-packagées et pré-compilées de PHP pour macOS. Cela peut être utile pour mettre en place une configuration standard, mais si vous avez besoin d'accéder à des fonctionnalités spécifiques (comme un serveur sécurisé, ou un pilote de bases de données exotiques), vous aurez à compiler PHP et/ou votre serveur Web vous-même. Si vous n'êtes pas familier avec la compilation et la mise en place d'applications, il est bon de vérifier si personne d'autre n'a pas déjà réalisé un paquet contenant les fonctionnalités que vous désirez.

La façon la plus rapide d'installer php sur macOS est avec homebrew :

  1. Installer homebrew, en suivant les instruction sur » brew.sh

  2. brew install php

Les ressources alternatives suivantes offrent la possibilité d'installer des paquets et des binaires précompilés pour PHP sous Mac OS :

add a note

User Contributed Notes 5 notes

up
9
marc_cole
1 year ago
Granted, this is not a "package", but I prefer to use phpbrew, as it allows me to install as many versions of PHP as I want for testing or whatever.

https://github.com/phpbrew/phpbrew
up
5
Chris Varen
5 months ago
@marc_cole Note that phpbrew (https://github.com/phpbrew/phpbrew) requires you already have some version of PHP on your system. This is because phpbrew itself is written in php. And recent versions of macOS no longer come with php included.

So phpbrew isn't really an alternative since you still need to use homebrew or something else to install php in the first place.
up
1
Sajt
1 year ago
You can use Laravel valet, what is included PHP, Nginx, DNSMasq and a lot of things for easy developing. (https://laravel.com/docs/8.x/valet)
up
0
saintalifrh at disroot dot org
1 year ago
Valet requires macOS and Homebrew. Before installation, you should make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80.

you need to install brew anyway
up
-4
Anonymous
7 months ago
remember after step 1 installing homebrew to run these two commands, one at a time in the terminal window - where xxxxx is the name of the current profile - (who you are logged in as)

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/xxxxx/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"

Only then will you be able to run step 2 brew...
To Top