在wamp2.0i下安装pear错误解决及安装全程

I have installed the latest version of Wampserver v2.0. I was trying to send email through my localhost using my ISP's SMTP, though it did not work out. Someone suggested installing PEAR or activating PHAR extension.

1] When i try to activate the PHAR extension "php_phar", an error message pops up 3 times:

Quote:
PHP Startup: Unable to load dynamic library "c:/wamp/bin/php/php5.3.0/ext/php_phar.dll' - The specified module could not be found.


Also, i did not find "php_phar.dll" file in "c:/wamp/bin/php/php5.3.0/ext directory.


Now, there is a PEAR directory i found in "C:/wamp/bin/php/php5.3.0/PEAR", though it only contains a single file called "go-pear.phar". And in the directory "C:/wamp/bin/php/php5.3.0" there is a file called "go-pear.bat".

2] When i tried to run click "go-pear.bat", it gave me the following errors:

Quote:
phar "C:/wamp/bin/php/php5.3.0/PEAR/go-pear.phar" does not have a signaturePHP W
arning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:/
wamp/bin/php/php5.3.0/PEAR/go-pear.phar on line 1236

Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:/
wamp/bin/php/php5.3.0/PEAR/go-pear.phar on line 1236
Press any key to continue . . .


解决方法:

So run:
php.exe -d phar.require_hash=0 go-pear.phar
(you might have to run "php.exe -d phar.require_hash=0 ./PEAR/go-pear.phar" if you execute from php root directory as I did)

Then you can use the pear command as usual.

Note: I also added "C:/wamp/bin/php/php5.3.0" to my path variable to be able to use php and pear from anywhere in command line.

All seem to work fine that way (at least now!) and using the latest version of wampserver!


安装过程:
Hello, in this tutorial I will explain step by step how to install PEAR and some of its packages in Windows with WAMP.

1. Download and install the latest version of the WAMP Server. This is the Windows AMP (Apache, MySQL & PHP) package that I use, but I do not doubt that the results will be equally satisfactory if you use another one, like XAMPP for example.

2. During the installation, I used the default paths proposed the installer: "C:/wamp", "C:/wamp/www", etc. Although these paths will be referenced in this tutorial, feel free to alter the paths to your needs.

3. Enter "C:/wamp/php", and locate and execute the file "go-pear.bat".

4. A command prompt window will be opened with the following message; press Enter to proceed.

5. Afterward, a list of up to 10 (this length may differ on XAMPP and others) filesystem locations will be displayed. Once again press Enter.

6. Then it will ask if we want to modify php.ini; Type in the letter "Y" (in capital letters) and press Enter.

7. To view this modification check the end of the "php.ini" (located in "C:/wamp/php") and you should see:

;***** Added by go-pear
include_path=".;C:/wamp/php/pear"
;*****

8. Next you will be notified that the include_path was updated. Press Enter to continue.

9. A final message announces that a file called PEAR_ENV.reg has been created, which, upon execution, will add some Windows environment variables.

10. Enter "C:/wamp/php" and double click the file called "PEAR_ENV.reg". When asked to confirm the addition of registry values choose "Yes" and then click "OK".

11. In "C:/wamp/php", copy the file pear.bat to "C:/WINDOWS/system32". Alternatively you can add "C:/wamp/php" to your windows PATH environment variable to expose this file globally.

12. Next open the run dialog and type "cmd" to open a command prompt window.

13. Type pear to see all available commands and verify proper installation. If this command is unrecognized you will have to review the previous steps and repeat anything you missed.

14. Next update the memory_limit property value to 64M in php.ini. This will help php script execution. This file is found in "C:/wamp/php/php.ini" and "C:/wamp/Apache2/bin/php.ini"; update both.

15. Now reinitiate the services/processes through WAMP.

Finally, whenever you update PEAR or some of its packages, copy pear.bat into system32 to update our list of PEAR commands. This extra step can be avoided if the path to pear.bat has been added to your PATH environment variable.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值