• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

PEAR wont install

Z

ZiRo

Guest
I can't get pear to install.

I got an error "Class 'PEAR' does not exist", then I replaced go-pear with the latest from http://go-pear.org/

Now I'm getting
Preparing installer..................
unknown command `update-channels'

Also, I forgot to back up the original go-pear.php, could someone supply it?

Thanks for your help,
 
I did the same thing except I got this when trying to run the "new" go-pear.php :

/*
* Generates a registry addOn for Win32 platform
* This addon set PEAR environment variables
* @Author Pierrre-Alain Joye
*/
function win32CreateRegEnv()
{
global $prefix, $bin_dir, $php_dir, $php_bin, $doc_dir, $data_dir, $test_dir
, $temp_dir;
$nl = "\r\n";
$reg ='REGEDIT4'.$nl.
'[HKEY_CURRENT_USER\Environment]'.$nl.
'"PHP_PEAR_SYSCONF_DIR"="'.addslashes($prefix).'"'.$nl.
'"PHP_PEAR_INSTALL_DIR"="'.addslashes($php_dir).'"'.$nl.
'"PHP_PEAR_DOC_DIR"="'.addslashes($doc_dir).'"'.$nl.
'"PHP_PEAR_BIN_DIR"="'.addslashes($bin_dir).'"'.$nl.
'"PHP_PEAR_DATA_DIR"="'.addslashes($data_dir).'"'.$nl.
'"PHP_PEAR_PHP_BIN"="'.addslashes($php_bin).'"'.$nl.
'"PHP_PEAR_TEST_DIR"="'.addslashes($test_dir).'"'.$nl;

$fh = fopen($prefix.DIRECTORY_SEPARATOR.'PEAR_ENV.reg','wb');
if($fh){
fwrite($fh, $reg ,strlen($reg));
fclose($fh);
echo "

* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under $prefix\\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

";
}
}

// }}}
// {{{ win32DetectPHPSAPI

/*
* Try to detect the kind of SAPI used by the
* the given php.exe.
* @Author Pierrre-Alain Joye
*/
function win32DetectPHPSAPI()
{
global $php_bin,$php_sapi_name;
if (WEBINSTALLER) {
return $php_sapi_name;
}
if($php_bin!=''){
exec($php_bin.' -v', $res);
if(is_array($res)) {
if( isset($res[0]) && strpos($res[0],"(cli)")) {
return 'cli';
}
if( isset($res[0]) && strpos($res[0],"cgi")) {
return 'cgi';
} else {
return 'unknown';
}
}
}
return 'unknown';
}

// }}}
// {{{ getPhpiniPath

/*
* Get the php.ini file used with the current
* process or with the given php.exe
*
* Horrible hack, but well ;)
*
* Not used yet, will add the support later
* @Author Pierre-Alain Joye <[email protected]>
*/
function getPhpiniPath()
{
$pathIni = get_cfg_var('cfg_file_path');
if( $pathIni && is_file($pathIni) ){
return $pathIni;
}

// Oh well, we can keep this too :)
// I dunno if get_cfg_var() is safe on every OS
if (WINDOWS) {
// on Windows, we can be pretty sure that there is a php.ini
// file somewhere
do {
$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini';
if ( @file_exists($php_ini) ) break;
$php_ini = 'c:\winnt\php.ini';
if ( @file_exists($php_ini) ) break;
$php_ini = 'c:\windows\php.ini';
} while (false);
} else {
$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini';
}

if( @is_file($php_ini) ){
return $php_ini;
}

// We re running in hackz&troubles :)
ob_implicit_flush(false);
ob_start();
phpinfo(INFO_GENERAL);
$strInfo = ob_get_contents ();
ob_end_clean();
ob_implicit_flush(true);

if ( php_sapi_name() != 'cli' ) {
$strInfo = strip_tags($strInfo,'<td>');
$arrayInfo = explode("</td>", $strInfo );
$cli = false;
} else {
$arrayInfo = explode("\n",$strInfo);
$cli = true;
}

foreach($arrayInfo as $val){
if ( strpos($val,"php.ini") ) {
if($cli){
list(,$pathIni) = explode('=>',$val);
} else {
$pathIni = strip_tags(trim($val) );
}
$pathIni = trim($pathIni);
if(is_file($pathIni)){
return $pathIni;
}
}
}

return false;
}

// }}}
// {{{ alterPhpIni

/*
* Not optimized, but seems to work, if some nice
* peardev will test it? :)
*
* @Author Pierre-Alain Joye <[email protected]>
*/
function alterPhpIni($pathIni='')
{
global $php_dir, $prefix;

$iniSep = WINDOWS?';':':';

if( $pathIni=='' ){
$pathIni = getphpinipath();
}

$arrayIni = file($pathIni);
$i=0;
$found=0;

// Looks for each active include_path directives
foreach ( $arrayIni as $iniLine ) {
$iniLine = trim($iniLine);
$iniLine = str_replace(array("\n","\r"),array(),$iniLine);
if( preg_match("/^include_path/",$iniLine) ){
$foundAt[] = $i;
$found++;
}
$i++;
}

if ( $found ) {
$includeLine = $arrayIni[$foundAt[0]];
list(,$currentPath)=explode('=',$includeLine);

$currentPath = trim($currentPath);
if(substr($currentPath,0,1)=='"'){
$currentPath = substr($currentPath,1,strlen($currentPath)-2);
}

$arrayPath = explode($iniSep, $currentPath);
if( $arrayPath[0]=='.' ){
$newPath[0] = '.';
$newPath[1] = $php_dir;
array_shift($arrayPath);
} else {
$newPath[0] = $php_dir;
}

foreach( $arrayPath as $path ){
$newPath[]= $path;
}
} else {
$newPath[0] = '.';
$newPath[1] = $php_dir;

}
$nl = WINDOWS?"\r\n":"\n";
$includepath = 'include_path="'.implode($iniSep,$newPath).'"';
$newInclude = "$nl$nl;***** Added by go-pear$nl".
$includepath.
$nl.";*****".
$nl.$nl;

$arrayIni[$foundAt[0]] = $newInclude;

for( $i=1; $i<$found; $i++){
$arrayIni[$foundAt[$i]]=';'.trim($arrayIni[$foundAt[$i]]);
}

$newIni = implode("",$arrayIni);
if ( !($fh = @fopen($pathIni, "wb+")) ){
$prefixIni = $prefix.DIRECTORY_SEPARATOR."php.ini-gopear";
$fh = fopen($prefixIni, "wb+");
if ( !$fh ) {
echo
"
******************************************************************************
WARNING! I cannot write to $pathIni nor in $prefix/php.ini-gopear. Please
modify manually your php.ini by adding:

$includepath

";
return false;
} else {
fwrite($fh, $newIni, strlen($newIni));
fclose($fh);
echo
"
******************************************************************************
WARNING! I cannot write to $pathIni, but I succesfully created a php.ini
under <$prefix/php.ini-gopear>. Please replace the file <$pathIni> w
ith
<$prefixIni> or modify your php.ini by adding:

$includepath

";

}
} else {
fwrite($fh, $newIni, strlen($newIni));
fclose($fh);
echo "
php.ini <$pathIni> include_path updated.
";
}
return true;
}

?>
</PRE></BODY></HTML>
Press any key to continue . . .

Ayone who can help?

You can download my go-pear.php from www.webnow.co.za/download/pear.zip
 
This is becoming a problem now. I need to install PEAR, the original install didnt work, I saught a fix, the fix doesnt work, there have been no responses.
 
Back
Top