似乎无法在 pear.bat 中设置我的 php.exe 路径 [英] Can't seem to set my php.exe path in pear.bat
问题描述
我安装了 PEAR,当我尝试运行它时,我收到以下消息:
I installed PEAR and when I try to run it, I receive this message:
PHP_PEAR_PHP_BIN 设置不正确.请使用您的修复它环境变量或者修改pear.bat中的默认值当前值为:.\php.exe
PHP_PEAR_PHP_BIN is not set correctly. Please fix it using your environment variable or modify the default value in pear.bat The current value is: .\php.exe
在 pear.bat 文件中,错误信息是这样生成的:
In the pear.bat file that error message is generated as such:
:PEAR_PHPBIN_ERROR
ECHO PHP_PEAR_PHP_BIN is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_PHP_BIN%
GOTO END
在文件的顶部有一个条件集,如下所示:
At the top of the file there is a conditional set like so:
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=.\php.exe"
这是我的起点.我已经改变了这个路径:
That's my starting point. I've changed that path to this:
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe"
无论更改如何,我都会在命令行中遇到相同的错误,因为它仍然认为值是 .\php.exe
.我可以调整错误消息,我的调整将出现在命令行中,所以我确信这个 pear.bat 文件正在被引用.
Regardless of the change, I get the same error in the command line, as in it still thinks the value is .\php.exe
. I can tweak the error message and my tweaks will appear in the command line so I'm confident this pear.bat file is being referenced.
所以我的假设是,基于该条件,"%PHP_PEAR_PHP_BIN%"!=""
如果是这种情况,它在哪里设置,以便我可以将其覆盖到我的正确路径?我应该在哪里查看或如何进一步解决此问题的想法?
So my assumption is, based on that condition, "%PHP_PEAR_PHP_BIN%"!=""
and if that is the case, where is it being set so I can override it to my correct path? Ideas where I should look or how to troubleshoot this further?
这是我的 pear.bat 源代码:http://codetidy.com/919/谢谢!
Here's my pear.bat source code: http://codetidy.com/919/ Thanks!
推荐答案
我能够通过删除条件来覆盖路径:
I was able to override the path by removing the condition:
已替换
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe"
与
SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe"
虽然这解决了我的问题,但我仍然想知道在此文件之前该值的设置位置.当然,我也确认 pear.ini
文件中的 php_bin
值中的路径是正确的.
Though this solved my issue, I'd still like to know where that value was being set prior to this file. I confirmed the path was correct in the php_bin
value in the pear.ini
file as well, of course.
这篇关于似乎无法在 pear.bat 中设置我的 php.exe 路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!