Unable to configure php.exe path in pear.bat

I installed PEAR, and when I try to start it, I get this message:

PHP_PEAR_PHP_BIN is set incorrectly. Correct it using an environment variable or change the default value in pear.bat. current value:. \ php.exe

In the pear.bat file, this 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 

There is a conditional set at the top of the file:

 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=.\php.exe" 

This is my starting point. I changed this way to this:

 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe" 

Regardless of the change, I get the same error on the command line, since it still considers the value .\php.exe . I can customize the error message and my settings will appear on the command line, so I'm sure this pear.bat file is referenced.

So, my assumption is based on this condition "%PHP_PEAR_PHP_BIN%"!="" , And if so, where is it installed, so can I redefine it to the correct path? Ideas I should look into and how to fix them?

Here is my pear.bat source code: http://codetidy.com/919/ Thanks!

+4
source share
7 answers

I was able to override the path by removing the condition:

Replaced by

 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe" 

with

 SET "PHP_PEAR_PHP_BIN=C:\hqp\xampp\php\php.exe" 

Although this solved my problem, I would still like to know where this value was set before this file. I also confirmed that the path was correct in the php_bin value in the php_bin file, of course.

+8
source

For Windows, you need to set "PHP_PEAR_PHP_BIN" in the user environment variable in the path to php.exe. Like me, I installed it in "C: \ wamp \ bin \ php \ php5.3.0 \ php.exe". This will solve your problem.

+6
source

Windows wamp variable set to environment variable

Go to System> Advanced System Settings.

Then set the environment variables as

 PHP_PEAR_PHP_BIN c:\wamp\bin\php\php5.3.13\php.exe 

Save Run cmd and enter the pear at the command prompt.

+1
source

You will find it in user variables in environment variables in windows. I ran into the same problem and then changed the value for user variables and worked.

0
source

the continuation of the installation of the document at http://pear.php.net/manual/en/installation.checking.php under verification includes the state of the loops for running php -ini on the command line. doing this, I noticed that the configuration file (php.ini) Path: was installed in c: \ windows (this is a widow xp machine). I thought it was weird, so I went looking for the file to see what was in it. There was no php.ini file, but there was a pear.ini file, so I decided to look at it. There are lines in it, the second is where I found the path. The file reads s: 7: "php_bin"; s: 9: ". \ Php.exe" near the end of the line I changed it to s: 7: "php_bin"; s: 9: "C: \ php \ php.exe" and everything was fine.

Just thought that I would update this, since I do not want to change batch files that do not need to be changed.

0
source

change the file. /php.exe to the actual path, for example, c: xampp \ php \ php. thanks

0
source

A simple solution without using the Windows environment variable.

You can edit the PEAR_ENV.reg file, available after the first installation of Pear. This file should be in your PHP folder. Inside this file you will find the following line:

 "PHP_PEAR_PHP_BIN"=".\\php.exe" 

to

 "PHP_PEAR_PHP_BIN"="F:\\PHP5.2\\php.exe" 

Change "F: \ PHP5.2" to where you are in PHP. Now you can double-click the PEAR_ENV.reg file to set the environment variable correctly.

0
source

All Articles