php Wamp 2.2 安装 PEAR
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8276682/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Wamp 2.2 install PEAR
提问by Cato Yeung
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
我的操作系统是 Windows 7。我在我的电脑上安装了 WAMP2.2。然后我尝试安装PEAR
. 但是,我go-pear.bat
在 wamp 目录中找不到我的文件。美好的。我在这里下载: http://pear.php.net/go-pear.phar
并使用此文件进行安装。我把文件放进去
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.
运行命令:php -d phar.require_hash=0 PEAR/go-pear.phar
安装后,我php.ini
在php和apache文件夹中包含pear的路径。我还包括C:/wamp/bin/php/php5.3.8/
在 windows$PATH
变量中。但是当我运行 pear 命令时。它说它找不到梨命令。我检查文件夹并找到一个名为pear.bat
and的文件pear.ini
。我尝试pear.bat
在命令行中再次运行。它仍然不起作用。请高手帮忙解决这个问题。
回答by Jose A
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. Run the command to install PEAR and you're over it.
并将其放在您的 WAMP 服务器目录下的 bin 文件夹中的 PHP 版本下。运行命令来安装 PEAR,你就完成了。
Example(defaults, no change has been done)
示例(默认值,未进行任何更改)
- Get the file on the link ->http://pear.php.net/go-pear.phar
- Go to this directory C:\wamp\bin\php\php5.3.13
- 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)
Use Window's cd command to change the directory to the go-pear.pharfile 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"
Press Enter. You should note that instead of saying "C:\system\32" is now displaying C:\wamp\bin\php\php5.3.13
Write the following command and press Enter:
php -d phar.require_hash=0 go-pear.phar
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 typingsystem
and pressing enter you'll install a system-wide copy.Type
yes
to confirm the option chosen.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
- 获取链接上的文件 ->http://pear.php.net/go-pear.phar
- 进入这个目录 C:\wamp\bin\php\php5.3.13
- 打开命令提示符 (cmd.exe)。假设您使用的是 Windows Vista 及更高版本,请按“开始”,键入“cmd.exe”并右键单击它并选择以管理员身份运行/CTRL+SHIFT+Enter(尚未对非特权进行测试)
使用 Window 的 cd 命令将目录更改为您刚刚下载的go-pear.phar文件。在我的情况下,我会将它指向我自己的目录,所以我这样做了如下:
cd "C:\wamp\bin\php\php5.3.13"
按 Enter。您应该注意,现在显示的是 C:\wamp\bin\php\php5.3.13 而不是“C:\system\32”
编写以下命令并按 Enter 键:
php -d phar.require_hash=0 go-pear.phar
选择您是否喜欢本地副本或系统副本。通过键入
system:local
并按回车键,您将安装本地副本。通过键入system
并按回车键,您将安装一个系统范围的副本。键入
yes
以确认选择的选项。下一个目录列表将是 PEAR 将安装其组件的引用目录。如果您从 1 - 12 中选择,您可以更改要安装的目录。通过键入
all
并按 Enter,您将能够以排队的方式更改它们。就我而言,我只是按 Enter 并保留所有默认值
DO THE FOLLOWING IN CASE YOU CONTINUE TO HAVE SOME LISTINGS11. 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+path 不包含您刚刚指定的 PEAR PHP 目录:如果指定的目录也不在您的脚本使用的 include_path 中,那么您将无法运行任何 PEAR 包。
Below it will also appear:
下面还会出现:
Would you like to alter php.ini ? [Y/n]:
你想改变 php.ini 吗?[是/否]:
Type y
and press enter
键入y
,然后按Enter
This should put you running with PEAR on WAMP server :)
这应该让你在 WAMP 服务器上运行 PEAR :)
回答by cweiske
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.
pear.bat
是windows上的可执行文件。您必须将该目录放在系统PATH
变量中才能识别命令。
回答by Aditya P Bhatt
All the steps mentioned to below link for GUI based - easy understanding review and setup:
以下链接中提到的所有基于 GUI 的步骤 - 易于理解的和设置:
回答by Nikki Aaron
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