怎样通过PHAR安装PEAR

2015年12月4日 | 分类: 【技术】

通过PHAR安装PEAR

wget http://pear.php.net/go-pear.phar
/usr/local/php/bin/php 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/local/php
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/local/php/bin
 5. PHP code directory ($php_dir)                 : /usr/local/php/lib/php
 6. Documentation directory                       : /usr/local/php/docs
 7. Data directory                                : /usr/local/php/data
 8. User-modifiable configuration files directory : /usr/local/php/cfg
 9. Public Web Files directory                    : /usr/local/php/www
10. System manual pages directory                 : /usr/local/php/man
11. Tests directory                               : /usr/local/php/tests
12. Name of configuration file                    : /usr/local/php/etc/pear.conf

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

按默认设置,按回车键,输出:

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

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/local/php/bin/pear' until you have added
** '/usr/local/php/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!

启动php-cgi进程

启动前可先测试下php-fpm.conf的语法是否正确。

/usr/local/php/sbin/php-fpm -t

输出:

[04-Dec-2015 01:53:04] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful

启动php-cgi进程后,监听的是127.0.0.1的9000端口,进程数为64(如果服务器内存小于3GB,可以只开启64个进程),用户为www。因为PHP-FPM配置文件中是用www来运行的。

/usr/local/php/sbin/php-fpm

输出:

ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
ERROR: FPM initialization failed

解决方法:

killall php-fpm

然后再重启即可。