Php 如何使用MAMP for OS X安装PEAR?

Php 如何使用MAMP for OS X安装PEAR?,php,pear,php-5.3,mamp,authentication,Php,Pear,Php 5.3,Mamp,Authentication,我想让PEAR和MAMP一起工作。我正在PEAR网站上运行以下内容: <?php require_once "Auth.php"; // Takes three arguments: last attempted username, the authorization // status, and the Auth object. // We won't use them in this simple demonstration -- but you can use them // t

我想让PEAR和MAMP一起工作。我正在PEAR网站上运行以下内容:

<?php
require_once "Auth.php";

// Takes three arguments: last attempted username, the authorization
// status, and the Auth object. 
// We won't use them in this simple demonstration -- but you can use them
// to do neat things.
function loginFunction($username = null, $status = null, &$auth = null)
{
    /*
     * Change the HTML output so that it fits to your
     * application.
     */
    echo "<form method=\"post\" action=\"test.php\">";
    echo "<input type=\"text\" name=\"username\">";
    echo "<input type=\"password\" name=\"password\">";
    echo "<input type=\"submit\">";
    echo "</form>";
}

$options = array(
  'dsn' => "mysql://user:password@localhost/database",
  );
$a = new Auth("DB", $options, "loginFunction");

$a->start();

if ($a->checkAuth()) {
    /*
     * The output of your site goes here.
     */
}
?>

我已经安装了PEAR,甚至可以从命令行运行
PEAR
,但是我完全无法在这个示例代码中运行PEAR:Auth。任何帮助都将不胜感激。

您必须在php.ini中包含PEAR路径


在该路径中应该是文件
Auth.php
,因此您可以查找该文件,然后获得其父目录绝对路径

这是我反复尝试但没有结果的东西,导致我难以置信的失败。事实证明,这是正确的答案,但MAMP不使用php.ini的本地副本,而是在每次重新启动时从模板文件创建新版本。一旦我将PEAR目录添加到模板的include_路径,事情就开始工作了。谢谢你的帮助。
Fatal error: require_once() [function.require]: Failed opening required 'Auth.php' (include_path='.:/Applications/MAMP/bin/php5.3/lib/php')