简体   繁体   English

Wamp 2.2安装PEAR

[英]Wamp 2.2 install PEAR

My operating system is Windows 7. I got my WAMP2.2 install in my computer. 我的操作系统是Windows 7.我在计算机上安装了WAMP2.2。 Then I try to install PEAR . 然后我尝试安装PEAR However, I can not find my go-pear.bat file in my wamp directory. 但是,我在wamp目录中找不到我的go-pear.bat文件。 Fine. 精细。 I download in here: http://pear.php.net/go-pear.phar and install using this file. 我在这里下载: http://pear.php.net/go-pear.pharhttp://pear.php.net/go-pear.phar并使用此文件安装。 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. 运行命令: php -d phar.require_hash=0 PEAR/go-pear.phar安装完成后,我在php和apache文件夹中包含php.ini中的pear路径。 I also include C:/wamp/bin/php/php5.3.8/ in windows $PATH variable. 我还在windows $PATH变量中包含C:/wamp/bin/php/php5.3.8/ But when I run pear command. 但是当我运行pear命令时。 It said it can not find the pear command. 它说它找不到梨命令。 I check the folder and just find a file called pear.bat and pear.ini . 我检查文件夹,找到一个名为pear.batpear.ini的文件。 I tried to run pear.bat again in command line. 我试图在命令行中再次运行pear.bat It still does not work. 它仍然无法正常工作。 Experts, please help on this issue. 专家,请帮忙解决这个问题。

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 我目前正在运行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

Now, to install PEAR do the following: 现在,要安装PEAR,请执行以下操作:

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

And put it on your WAMP server directory under the PHP version on the bin folder. 并将它放在bin文件夹上的PHP版本下的WAMP服务器目录中。 Run the command to install PEAR and you're over it. 运行命令安装PEAR,你就完成了它。

Example (defaults, no change has been done) 示例 (默认值,未进行任何更改)

  1. Get the file on the link ->http://pear.php.net/go-pear.phar 获取链接上的文件 - > http://pear.php.net/go-pear.phar
  2. Go to this directory C:\\wamp\\bin\\php\\php5.3.13 转到此目录C:\\ wamp \\ bin \\ php \\ php5.3.13
  3. Open command prompt (cmd.exe). 打开命令提示符(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) 假设您使用的是Windows Vista及更高版本,请按“开始”,键入“cmd.exe”并右键单击它并选择以管理员身份运行/ CTRL + SHIFT + Enter(未测试非特权权限)
  4. Use Window's cd command to change the directory to the go-pear.phar file you've just downloaded. 使用Window的cd命令将目录更改为刚刚下载的go-pear.phar文件。 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. 按Enter键。 You should note that instead of saying "C:\\system\\32" is now displaying C:\\wamp\\bin\\php\\php5.3.13 你应该注意,而不是说“C:\\ system \\ 32”现在显示C:\\ wamp \\ bin \\ php \\ php5.3.13

  6. Write the following command and press Enter: 编写以下命令并按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. 通过键入system:local并按Enter键,您将安装本地副本。 By typing system and pressing enter you'll install a system-wide copy. 通过键入system并按Enter键,您将安装系统范围的副本。

  8. Type yes to confirm the option chosen. 键入yes以确认所选的选项。

  9. The next list of directories, will be the referring directories that PEAR will install its components. 下一个目录列表将是PEAR将安装其组件的引用目录。 If you select from 1 - 12 you can change the directory you'd like to install. 如果从1 - 12中选择,则可以更改要安装的目录。 By typing all and pressing Enter you'll be able to change them all in a queued manner. 通过输入all并按Enter键,您将能够以排队的方式更改它们。 In my case, I just pressed Enter and left all defaults 就我而言,我只需按Enter键并保留所有默认值

DO THE FOLLOWING IN CASE YOU CONTINUE TO HAVE SOME LISTINGS 11. It is very probable that afterwards you'll receive a message like: 如果以下情况继续进行,请继续阅读以下内容 11.之后您很可能会收到如下消息:

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. 当前使用的php.ini中定义的include +路径不包含您刚刚指定的PEAR PHP目录:如果指定的目录也不在脚本使用的include_path中,则在使任何PEAR包工作时都会遇到问题。

Below it will also appear: 下面还会出现:

Would you like to alter php.ini ? 你想改变php.ini吗? [Y/n]: [Y / N]:

Type y and press enter 输入y并按Enter键

This should put you running with PEAR on WAMP server :) 这应该让你在WAMP服务器上运行PEAR :)

All the steps mentioned to below link for GUI based - easy understanding review and setup: 基于GUI的下面提到的所有步骤链接 - 易于理解审查和设置:

Click here 点击这里

For anyone looking for a more current answer. 对于任何寻找更新答案的人。 On Windows 10 I had to edit .bash_profile to add the following: 在Windows 10上,我必须编辑.bash_profile以添加以下内容:

function __pear {
    pear.bat $@
}

alias pear=__pear

pear.bat is the executable on windows. pear.bat是Windows上的可执行文件。 You have to put that directory in your system's PATH variable for the command to be recognized. 您必须将该目录放在系统的PATH变量中才能识别命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM