Instalación de pecl y pear en OS X 10.11 El Capitan, macOS 10.12 Sierra, macOS 10.13 High Sierra


Así que parece que el nuevo 'System Integrity Protection' lockdown de /usr (entre otros directorios) hace que pear y pecl no empiecen. ¿Alguien ha encontrado una solución a corto de desactivarlo?

Author: Paul Schreiber, 2015-10-01

8 answers

Hay una manera mucho más fácil-no hay necesidad de desactivar SIP o descargar su propia copia:

sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin
 63
Author: Paul Schreiber,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-01-22 19:14:04

No debe instalar binarios en system /usr, use /usr/local en su lugar.


Los comandos pecl y pear deberían venir junto con PHP al instalar a través de Homebrew.

Aquí está el ejemplo instalando PHP con el Homebrew más reciente:

brew install [email protected]

O la versión anterior:

brew install [email protected]

Para encontrar sus comandos pecl y pear, ejecute:

find -L "$(brew --prefix [email protected])" -name pecl -o -name pear

Si no lo tiene, considere desinstalar la versión anterior de PHP o ejecute reinstall en su lugar.

Usted también puede tratar de volver a vincularlo por:

brew unlink [email protected] && brew link [email protected] --dry-run && brew link --overwrite --force [email protected]

De lo contrario , enlázalo manualmente:

ln -vs "$(find -L "$(brew --prefix [email protected])/bin" -name pecl)" /usr/local/bin
ln -vs "$(find -L "$(brew --prefix [email protected])/bin" -name pear)" /usr/local/bin

Alternativamente, descargue Pear it directamente como un paquete Phar:

curl -o /usr/local/bin/pear http://pear.php.net/go-pear.phar
chmod +x /usr/local/bin/pear

O con esta siguiente línea (funcionará en Linux, pero no en Unix):

install -v -m755 <(curl -sL http://pear.php.net/go-pear.phar) /usr/local/bin/pear
 42
Author: kenorb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-20 15:51:01

Desde este enlace: http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x / Con estas instrucciones, no es necesario desactivar 'Protección de Integridad del sistema'

The following instructions install PEAR and PECL on Mac OS X under /usr/local/. PECL is bundled with PEAR. So this is as simple as installing PEAR on Mac OS X.

PEAR is PHP’s Package Repository and makes it easy to download and install PHP tools like PHPUnit and XDebug. I specifically recommend these two for every PHP developer.

Download PEAR
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

Configure and Install PEAR
You should now be at a prompt to configure PEAR.

Type 1 and press return.
Enter: /usr/local/pear

Type 4 and press return.
Enter: /usr/local/bin

Press return

Verify PEAR. You should be able to type:

pear version

Eventually, if you use any extensions or applications from PEAR, you may need to update PHP’s include path.
 25
Author: Sergii Smirnov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-30 20:00:26

Añadir sufijo --with-pear para instalar pear y pecl
Véase el ejemplo siguiente

brew install php --with-pear
brew reinstall php --with-pear
 2
Author: user3890355,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-07 10:01:25

Aquí hay un enlace a un artículo de Macworld que describe cómo habilitar y deshabilitar la Protección de Integridad del Sistema.'

Http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html

 0
Author: RichardD,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-02 12:00:58

Esto funcionó para mí a partir de macOS Sierra 10.12.1 para actualizar PHP, instalar PEAR y V8

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php

phpversion="$(php -v | tail -r | tail -n 1 | cut -d " " -f 2 | cut -c 1,3)"
brew unlink php$phpversion

brew install php71
brew install autoconf

curl -O  http://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar

echo -e "\nexport PATH=$HOME/pear/bin:$PATH \n"

source ~/.bash_profile

echo -e "\ninclude_path = '.:/Users/YOURUSERNAME/pear/share/pear/' \nextension=v8js.so \n" >> /usr/local/etc/php/7.1/php.ini

git clone https://github.com/phpv8/v8js ~/tmp/v8js && cd $_
./configure CXXFLAGS="-Wno-c++11-narrowing"
make
make test
make install

sudo apachectl restart
 0
Author: davidcondrey,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-12-09 23:45:34

Configuración de High Sierra:

  • instalar Brew
  • instalar PHP con Brew

Hay un PAQUETE PERA preinstalado en

/usr/local/opt/php@<your_version>/bin

Desde allí se puede ejecutar

pecl install xdebug

Y usted debe tener binario PHP de trabajo con Xdebug.

 0
Author: xrep,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-15 11:42:59

Cuando se usa brew y no se vincula, use:

brew install [email protected]
brew unlink [email protected]

$(brew --prefix [email protected])/bin/pecl
$(brew --prefix [email protected])/bin/pear
 0
Author: Mike,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-20 19:20:09