天天看点

Mac 安装peal的过程以及问题

红色为错误。黄色为错误提示。黑色为正确。

1.下载peal

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

出错:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>301 Moved Permanently</title>

</head><body>

<h1>Moved Permanently</h1>

<p>The document has moved <a href="https://pear.php.net/go-pear.phar" target="_blank" rel="external nofollow" >here</a>.</p>

</body></html>

然后执行:

 1.1下载:curl -O https://pear.php.net/go-pear.phar

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 3523k  100 3523k    0     0   159k      0  0:00:22  0:00:22 --:--:--  246k

 1.2安装:sudo php -d detect_unicode=0 go-pear.phar

Below is a suggested file layout for your new PEAR installation.  To

change individual locations, type the number in front of the

directory.  Type 'all' to change all of them or simply press Enter to

accept these locations.

 1. Installation base ($prefix)                   : /usr

 2. Temporary directory for processing            : /tmp/pear/install

 3. Temporary directory for downloads             : /tmp/pear/install

 4. Binaries directory                            : /usr/bin

 5. PHP code directory ($php_dir)                 : /usr/share/pear

 6. Documentation directory                       : /usr/docs

 7. Data directory                                : /usr/data

 8. User-modifiable configuration files directory : /usr/cfg

 9. Public Web Files directory                    : /usr/www

10. System manual pages directory                 : /usr/man

11. Tests directory                               : /usr/tests

12. Name of configuration file                    : /private/etc/pear.conf

2.1配置Installation base

1-12, 'all' or Enter to continue: 1  注释:enter键

(Use $prefix as a shortcut for '/usr', etc.)

Installation base ($prefix) [/usr] : /usr/local/pear 注释:enter键

Below is a suggested file layout for your new PEAR installation.  To

change individual locations, type the number in front of the

directory.  Type 'all' to change all of them or simply press Enter to

accept these locations.

 1. Installation base ($prefix)                   : /usr/local/pear

 2. Temporary directory for processing            : /tmp/pear/install

 3. Temporary directory for downloads             : /tmp/pear/install

 4. Binaries directory                            : /usr/local/pear/bin

 5. PHP code directory ($php_dir)                 : /usr/local/pear/share/pear

 6. Documentation directory                       : /usr/local/pear/docs

 7. Data directory                                : /usr/local/pear/data

 8. User-modifiable configuration files directory : /usr/local/pear/cfg

 9. Public Web Files directory                    : /usr/local/pear/www

10. System manual pages directory                 : /usr/local/pear/man

11. Tests directory                               : /usr/local/pear/tests

12. Name of configuration file                    : /private/etc/pear.conf

2.2配置Binaries directory

1-12, 'all' or Enter to continue: 4  注释:enter键

(Use $prefix as a shortcut for '/usr/local/pear', etc.)

Binaries directory [$prefix/bin] : /usr/local/bin  注释:enter键

Below is a suggested file layout for your new PEAR installation.  To

change individual locations, type the number in front of the

directory.  Type 'all' to change all of them or simply press Enter to

accept these locations.

 1. Installation base ($prefix)                   : /usr/local/pear

 2. Temporary directory for processing            : /tmp/pear/install

 3. Temporary directory for downloads             : /tmp/pear/install

 4. Binaries directory                            : /usr/local/bin

 5. PHP code directory ($php_dir)                 : /usr/local/pear/share/pear

 6. Documentation directory                       : /usr/local/pear/docs

 7. Data directory                                : /usr/local/pear/data

 8. User-modifiable configuration files directory : /usr/local/pear/cfg

 9. Public Web Files directory                    : /usr/local/pear/www

10. System manual pages directory                 : /usr/local/pear/man

11. Tests directory                               : /usr/local/pear/tests

12. Name of configuration file                    : /private/etc/pear.conf

1-12, 'all' or Enter to continue: 

Beginning install...

Configuration written to /private/etc/pear.conf...

Initialized registry...

Preparing to install...

installing phar:///Users/lixiaosha/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.7.tar...

installing phar:///Users/lixiaosha/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.2.tar...

installing phar:///Users/lixiaosha/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.9.tar...

installing phar:///Users/lixiaosha/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...

installing phar:///Users/lixiaosha/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.3.tar...

install ok: channel://pear.php.net/Archive_Tar-1.4.7

install ok: channel://pear.php.net/Console_Getopt-1.4.2

install ok: channel://pear.php.net/Structures_Graph-1.1.1

install ok: channel://pear.php.net/XML_Util-1.4.3

install ok: channel://pear.php.net/PEAR-1.10.9

PEAR: Optional feature webinstaller available (PEAR's web-based installer)

PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)

PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)

PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************

WARNING!  The include_path defined in the currently used php.ini does not

contain the PEAR PHP directory you just specified:

</usr/local/pear/share/pear>

If the specified directory is also not in the include_path used by

your scripts, you will have problems getting any PEAR packages working.

3.1更改php.ini

Would you like to alter php.ini </etc/php.ini>? [Y/n] : y 注释:enter键

php.ini </etc/php.ini> include_path updated.

Current include path           : .:

Configured directory           : /usr/local/pear/share/pear

Currently used php.ini (guess) : /etc/php.ini

Press Enter to continue: 注释:enter键

The 'pear' command is now at your service at /usr/local/bin/pear

** The 'pear' command is not currently in your PATH, so you need to

** use '/usr/local/bin/pear' until you have added

** '/usr/local/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'

to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php

  http://pear.php.net/manual/

Thanks for using go-pear!

4.1检查安装pear version

PEAR Version: 1.10.9

PHP Version: 7.1.23

Zend Engine Version: 3.1.0

继续阅读