Wamp 2.2 安装 PEAR

发布于 2024-12-18 00:55:32 字数 635 浏览 1 评论 0原文

我的操作系统是Windows 7。 我的计算机上安装了 WAMP2.2。 然后我尝试安装 PEAR。 但是,我在 wamp 目录中找不到我的 go-pear.bat 文件。 美好的。我在这里下载:http://pear.php.net/go-pear.phar 并使用该文件进行安装。 我将文件放入

 C:/wamp/bin/php/php5.3.8/pear/go-pear.phar

运行命令:php -d phar.require_hash=0 PEAR/go-pear.phar 安装后,我将 pear 的路径包含在 php 和 apache 文件夹中的 php.ini 中。 我还在 Windows $PATH 变量中包含了 C:/wamp/bin/php/php5.3.8/ 。 但是当我运行 pear 命令时。它说找不到 pear 命令。 我检查了该文件夹,只找到了一个名为 pear.batpear.ini 的文件。 我尝试在命令行中再次运行 pear.bat 。它仍然不起作用。 请专家帮忙解决这个问题。

My operating system is Windows 7.
I got my WAMP2.2 install in my computer.
Then I try to install PEAR.
However, I can not find my go-pear.bat file in my wamp directory.
Fine. I download in here: http://pear.php.net/go-pear.phar
and install using this file.
I put the file in

 C:/wamp/bin/php/php5.3.8/pear/go-pear.phar

Run the command: php -d phar.require_hash=0 PEAR/go-pear.phar
After the installation, I include the path of pear in php.ini in php and apache folder.
I also include C:/wamp/bin/php/php5.3.8/ in windows $PATH variable.
But when I run pear command. It said it can not find the pear command.
I check the folder and just find a file called pear.bat and pear.ini.
I tried to run pear.bat again in command line. It still does not work.
Experts, please help on this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

柠檬色的秋千 2024-12-25 00:55:32

好吧,因为很多人可能会问同样的事情。让我们假设以下情况。
我目前正在运行 2.2 E,其中包括 Apache 2.2.22 – Mysql 5.5.24 – PHP 5.3.13 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0

现在,要安装 PEAR,请执行以下操作:

下载此文件:
http://pear.php.net/go-pear.phar

并放在你的WAMP服务器目录下bin 文件夹中的 PHP 版本。
运行命令来安装 PEAR,然后就完成了。

示例(默认,未做任何更改)

  1. 获取链接上的文件 ->http://pear.php.net/go-pear.phar
  2. 进入此目录 C:\wamp\ bin\php\php5.3.13
  3. 打开命令提示符(cmd.exe)。假设您使用的是 Windows Vista 及更高版本,请按“开始”,输入“cmd.exe”并右键单击它,然后选择以管理员身份运行/CTRL+SHIFT+Enter(尚未在非特权权限上进行测试)
  4. 使用Windows 的 cd 命令将目录更改为您刚刚下载的 go-pear.phar 文件。就我而言,我将把它指向我自己的目录,所以我这样做了:

    cd "C:\wamp\bin\php\php5.3.13"

  5. 按 Enter。您应该注意到,现在显示的不是“C:\system\32”而是 C:\wamp\bin\php\php5.3.13

  6. 编写以下命令并按 Enter:

    php -d phar.require_hash=0 go-pear.phar

  7. 选择您是否喜欢本地副本或系统副本。通过输入 system:local 并按 Enter 键,您将安装本地副本。通过输入 system 并按 Enter 键,您将安装系统范围的副本。

  8. 键入 yes 确认所选选项。

  9. 下一个目录列表将是 PEAR 将安装其组件的引用目录。如果您选择 1 - 12,您可以更改要安装的目录。通过输入 all 并按 Enter 键,您将能够以排队方式更改所有内容。 在我的例子中,我只是按 Enter 并保留所有默认值

如果您继续拥有一些列表,请执行以下操作
11. 之后您很可能会收到如下消息:

警告!当前使用的 php.ini 中定义的 include+path 不包含您刚刚指定的 PEAR PHP 目录:如果指定的目录也不在您的脚本使用的 include_path 中,那么您将无法使任何 PEAR 包正常工作。

下面还会出现:

您想更改 php.ini 吗? [是/否]:

输入 y 并按 Enter

这应该会让您在 WAMP 服务器上运行 PEAR :)

Ok since many people may be asking the same thing. Let's suppose the following.
I'm currently running 2.2 E which includes Apache 2.2.22 – Mysql 5.5.24 – PHP 5.3.13 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0

Now, to install PEAR do the following:

Download this file:
http://pear.php.net/go-pear.phar

And put it on your WAMP server directory under the PHP version on the bin folder.
Run the command to install PEAR and you're over it.

Example (defaults, no change has been done)

  1. Get the file on the link ->http://pear.php.net/go-pear.phar
  2. Go to this directory C:\wamp\bin\php\php5.3.13
  3. Open command prompt (cmd.exe). Supposing you're using Windows Vista and higher, press Start, type "cmd.exe" and right click on it and select run as administrator/CTRL+SHIFT+Enter (Haven't tested on non-priviliges rights)
  4. Use Window's cd command to change the directory to the go-pear.phar file you've just downloaded. In my case I'll be pin pointing it to my own directory, so I did it like follows:

    cd "C:\wamp\bin\php\php5.3.13"

  5. Press Enter. You should note that instead of saying "C:\system\32" is now displaying C:\wamp\bin\php\php5.3.13

  6. Write the following command and press Enter:

    php -d phar.require_hash=0 go-pear.phar

  7. Select whether you like or not a local copy or a system one. By typing system:local and pressing enter you'll install a local copy. By typing system and pressing enter you'll install a system-wide copy.

  8. Type yes to confirm the option chosen.

  9. The next list of directories, will be the referring directories that PEAR will install its components. If you select from 1 - 12 you can change the directory you'd like to install. By typing all and pressing Enter you'll be able to change them all in a queued manner. In my case, I just pressed Enter and left all defaults

DO THE FOLLOWING IN CASE YOU CONTINUE TO HAVE SOME LISTINGS
11. It is very probable that afterwards you'll receive a message like:

WARNING! The include+path defined in the currently used php.ini does not contain the PEAR PHP directory you just specified: If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working.

Below it will also appear:

Would you like to alter php.ini ? [Y/n]:

Type y and press enter

This should put you running with PEAR on WAMP server :)

所谓喜欢 2024-12-25 00:55:32

pear.bat 是 Windows 上的可执行文件。您必须将该目录放入系统的 PATH 变量中才能识别该命令。

pear.bat is the executable on windows. You have to put that directory in your system's PATH variable for the command to be recognized.

以为你会在 2024-12-25 00:55:32

以下提到的所有步骤均基于 GUI 链接 - 易于理解的审查和设置:

点击此处

All the steps mentioned to below link for GUI based - easy understanding review and setup:

Click here

梦在夏天 2024-12-25 00:55:32

对于任何寻找更新答案的人。在 Windows 10 上,我必须编辑 .bash_profile 以添加以下内容:

function __pear {
    pear.bat $@
}

alias pear=__pear

For anyone looking for a more current answer. On Windows 10 I had to edit .bash_profile to add the following:

function __pear {
    pear.bat $@
}

alias pear=__pear
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文