【问题标题】:php MAMP path problemphp MAMP路径问题
【发布时间】:2011-04-23 03:27:53
【问题描述】:

您好,我下载了一些 PEAR 文件,它们位于我的 MAMP 目录的 bin 文件夹中。在 bin 文件夹中,它们位于一堆子文件夹(php 5.3/lib/php/pear 等)中,如下所示

但是,需要 PEAR 的文件位于 htdocs 中,因此它们根本没有连接。由于我是新手,所以我对从 bin 中的 php 文件夹中获取所有这些文件并将它们移动到 htdocs 持谨慎态度,但是将它们包含在 htdocs 的每个文件中也是一个复杂的文件路径。

有人用过梨吗?是不是应该这样设置?

更新 Pear 文件夹的屏幕截图,以及指出建议的 pear 位置的终端屏幕截图

# Setting PATH for MacPython 2.6
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
export PATH

# Setting PATH for MacPython 2.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

#I HAVE ADDED THE PATH HERE
export PATH=$PATH:/usr/local/mysql/bin:/Users/michaelmitchell/pear/bin/


# Setting PATH for Python 3.2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
export PATH



File Name to Write: .bash_profile    (HIT ENTER)                                           
^G Get Help         ^T To Files         M-M Mac Format      M-P Prepend
^C Cancel           M-D DOS Format      M-A Append          M-B Backup File

【问题讨论】:

    标签: php pear mamp


    【解决方案1】:

    您好,我下载了一些 PEAR 文件

    您是下载的还是 MAMP 自带的?你安装梨了吗??

    什么意思

    需要 PEAR 的文件在 htdocs 中

    无论如何,对于每个操作系统,安装 pear 都是相似的。 因此,您必须在 PHP 5.3 文件夹中调用文件 php go-pear.phar(将安装 pear)

    如果没有,请尝试这些(根据您的操作系统版本查看 MacOS 安装)

    http://pear.php.net/manual/en/installation.getting.php

    重新安装你的 PEAR

    $ wget http://pear.php.net/go-pear.phar
    $ sudo php -d detect_unicode=0 go-pear.phar
    

    http://www.bsp.ca/?p=108

    然后你打电话给sudo pear install package_name 你不需要在你的htdocs 中包含任何东西。一旦安装了 PEAR 和相关包,需要 PEAR(或 PEAR 包)的文件将由 php 处理

    # Setting PATH for MacPython 2.6
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
    export PATH
    
    # Setting PATH for MacPython 2.5
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
    export PATH
    
    #I HAVE ADDED THE PATH HERE
    export PATH=$PATH:/usr/local/mysql/bin:/Users/michaelmitchell/pear/bin/
    
    
    # Setting PATH for Python 3.2
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
    export PATH
    

    【讨论】:

    • 谢谢,我不知道他们是否带有 MAMP。它在我的安装中没有说明任何内容。无论如何,有人告诉我这样做“curl pear.php.net/go-pear.phar > go-pear.phar”来下载文件,而不是再次“sudo php go-pear.phar”我做了第一个但是当我做了第二个我得到了一些?????然后它退出了。此问题在此博客 technosophos.com/content/… 中进行了描述,但我无法获得解决方案。
    • @Michael 这样做$ wget http://pear.php.net/go-pear.phar $ sudo php -d detect_unicode=0 go-pear.phar 这将重新安装 PEAR。你有什么原因??是因为 Unicode 字符。我会更新答案
    • 关于您在原始答案中的说明,我不知道如何从命令行访问 php 5.3 文件夹以调用文件 php go-pear phar
    • 我按照你的指示重新 wget pear.php.net/go-pear.phar 并说“未找到 wget 命令”
    • @Micheal 你的 MAMP 文件夹在哪里?我附近没有 Mac,但右键单击文件夹并查看属性(查看信息??)。这将显示文件夹的路径。然后在命令行中输入cd /path/to/the/folder/
    猜你喜欢
    • 1970-01-01
    • 2015-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-07
    • 1970-01-01
    • 2013-11-09
    相关资源
    最近更新 更多