Compilare și instalare PHP pe Mac OSX Ventura 13.1

De la YO3ITI
Sari la navigare Sari la căutare

Folosesc foarte mult mac-ul pentru dezvoltare, inclusiv dezvoltare web. O dată cu OSX Monterrey, Apple a renunțat să includă PHP în sistemul de operare, considerând PHP o vulnerabilitate ne-necesară. Ca atare, unicul mpd în care poți instala și folosi PHP este compilarea din surse. Mai jos etapele.

Descărcare surse

Se crează un folder pentru surse și se descarcă distribuția dorită. Acest exemplu include PHP 8.2.0

tom@MacBook-Pro-Miron src % pwd
/Users/tom/Downloads/php/src
tom@MacBook-Pro-Miron src %

Pentru descărcare utilizez curl

tom@MacBook-Pro-Miron src % man curl
curl(1)                                                           curl Manual                                                           curl(1)

NAME
       curl - transfer a URL

SYNOPSIS
       curl [options / URLs]

DESCRIPTION
       curl is a tool for transferring data from or to a server. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP,
       HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET or TFTP. The command is
       designed to work without user interaction.

       curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file
       transfer resume and more. As you will see below, the number of features will make your head spin.

       curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.

URL
       The URL syntax is protocol-dependent. You find a detailed description in RFC 3986.

       You can specify multiple URLs or parts of URLs by writing part sets within braces and quoting the URL as in:

: