为什么在安装PEAR时收到错误?
我想安装PEAR以便与PHP一起使用。当我阅读http://pear.php.net/manual/en/installation.getting.php 的安装说明时,我应该运行我在C:\ wamp \ bin \ php \ php5.3.0目录中的文件go-pear.bat。根据我已阅读的所有安装指南,它应该安装并询问我一系列安装问题,但我收到以下错误:为什么在安装PEAR时收到错误?
phar“C:\ wamp \ bin \ php \ php5.3.0 \ PEAR \ go-pear.phar“没有签名 PHP警告:require_once(phar://go-pear.par/index.php):未能打开流:phar错误:无效url或不存在的phar”药业://go-pear.phar/index.php”在C:\ WAMP \上线斌\ PHP \ php5.3.0 \ PEAR \去-pear.phar 1236
警告:require_once(药业: //go-pear.par/index.php):未能打开流:phar错误:无效网址或在C:\ wamp \ bin中不存在的phar“phar://go-pear.phar/index.php” \ PHP \ php5.3.0 \ PEAR \ go-pear.phar on line 1236 按任意键继续...
我不确定为什么我收到此错误。我刚刚安装了新的Wampserver。
也许this is你在找什么?
步骤如下:
1) Locate the "php.ini" file. In my case, I found it at this path:
C:\wamp\bin\php\php5.3.0\php.ini
Don't use the WAMP system tray icon to edit this file. It didn't work when I tried - you have to manually locate it.
2) Find the following line, in bold:
; http://php.net/phar.require-hash;phar.require_hash = On ; http://php.net/phar.require-hash
;phar.require_hash = On
3) Uncomment the ";phar.require_hash = On" line by removing the semi-colon.
4) Change "On" to "Off".
; http://php.net/phar.require-hash
phar.require_hash = Off
5) Save the file.
After I performed those steps, "go-pear.bat" began working normally again.
你应该可以启动它,而不使用编辑php.ini文件:
PATH/TO/php.exe -d phar.require_hash=0 PATH/TO/go-pear.phar
WOW!就是这样!非常感谢你!我把头发拉出来了!你知道为什么会发生这种情况吗?我很惊讶更多的人没有这个问题。 – zeckdude 2009-10-31 01:06:51
这对我来说也是如此。请注意,在我的版本中,PHP 5.3.5与ZendServer CE软件包捆绑在一起,php.ini中的行_phar.require_hash = Off_ wasnt并不需要添加。 – Cooter 2011-05-20 15:04:48
我的php.ini中没有[phar]部分。只需在单行“phar.require_hash = Off”中添加“[phar]”部分即可使用!谢谢) – Volshebnik 2011-11-01 13:04:10