重新安装PHP Pear

时间:2013-03-05 04:13:54

标签: php macos phpunit pear macports

我曾经有过MAMP(http://www.mamp.info/en/index.html)。卸载并通过Macports安装“MAMP”。

我完全删除了/ Applications / MAMP /文件夹。我现在想通过pear安装PHPUnit。

安装了梨:

> which pear
/opt/local/bin/pear

> pear config-show
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          /Applications/MAMP/bin/php/php5.3.6/bin/
PEAR documentation directory   doc_dir          /Applications/MAMP/bin/php5.3/docs
PHP extension directory        ext_dir          /opt/local/lib/php/extensions/no-debug-non-zts-20090626
PEAR directory                 php_dir          /Applications/MAMP/bin/php5.3/share/pear
PEAR Installer cache directory cache_dir        /private/tmp/pear/cache
PEAR configuration file        cfg_dir          /Applications/MAMP/bin/php5.3/cfg
directory
PEAR data directory            data_dir         /Applications/MAMP/htdocs/pear
PEAR Installer download        download_dir     /tmp/pear/install
directory
PHP CLI/CGI binary             php_bin          /opt/local/bin/php
php.ini location               php_ini          <not set>
--program-prefix passed to     php_prefix       <not set>
PHP's ./configure
--program-suffix passed to     php_suffix       <not set>
PHP's ./configure
PEAR Installer temp directory  temp_dir         /tmp/pear/install
PEAR test directory            test_dir         /Applications/MAMP/bin/php5.3/tests
PEAR www files directory       www_dir          /Applications/MAMP/bin/php5.3/www
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            22
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          /usr/local/bin/gpg
Signature Key Directory        sig_keydir       /opt/local/etc/pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         /Users/*removed*/.pearrc
System Configuration File      Filename         /opt/local/etc/pear.conf

我删除了很多对/ Applications / MAMP /文件夹结构的引用(并神秘地保持重新生成)。我想删除所有这些引用,但不确定应该是什么替代值。我似乎无法卸载梨或升级梨。

理想情况下,我想要安装pear并安装PHPUnit以便我可以运行一些测试。

1 个答案:

答案 0 :(得分:3)

您可以使用pear config-set调整这些配置值,例如

$ pear config-set php_dir /usr/share/pear/php
$ pear config-set data_dir /usr/share/pear/data

对所有具有“损坏”路径的配置值执行此操作。

之后,手动将文件从旧目录移动到新目录,或重新安装所有包。