Errores con PEAR en Horde de Plesk 8.1 en un Dedicated Server de GoDaddy con Windows Server 2003
Junio 20th, 2007 | Published in Sin categoría
El problema es que Plesk 8 utiliza una version personalizada de Horde con una version del paquete DB de PEAR obsoleta. Esto causa errores de este tipo:
PHP Fatal error: Cannot use object of type DB_sqlite as array in C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataT ree.php on line 656 PHP Fatal error: Cannot use object of type DB_mysql as array in /usr/share/psa-horde/lib/Horde/DataTree.php on line 657
Bueno la solucion rápida y mas lógica es actualizar el paquete DB de PEAR para que sea compatible con la version de PHP 5, aunque se puede realizar solo con el comando: pear upgrade DB, esto me llego a causar una serie de problemas que les voy a postear aqui (aunque me voy a enfocar a Plesk 8.1 para Windows y Horde utilizando sqlite, el problema se resuelve de una forma muy similar en Linux con Horde para MySQL, al final viene una referencia para Linux):
Primero que nada intenté el comando que comento en el parrafo pasado, y obtengo este resultado:
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade DB downloading DB-1.7.11.tgz ... Starting to download DB-1.7.11.tgz (132,064 bytes) .............................done: 132,064 bytes requires package `PEAR' >= 1.0b1 DB: Dependencies failed C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade DB downloading DB-1.7.11.tgz ... Starting to download DB-1.7.11.tgz (132,064 bytes) .............................done: 132,064 bytes requires package `PEAR' >= 1.0b1 DB: Dependencies failed
El primer problema es una dependencia al paquete PEAR, por lo que por lógica opto por actualizar tambien PEAR asi:
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade PEAR downloading PEAR-1.6.0.tgz ... Starting to download PEAR-1.6.0.tgz (296,465 bytes) .........................done: 296,465 bytes requires package `PEAR' >= 1.3.3 requires package `Archive_Tar' >= 1.3.1 requires package `Console_Getopt' >= 1.2 requires package `Structures_Graph' >= 1.0.2 PEAR: Dependencies failed
Más dependencias, intentamos actualizarlas
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade Archive_Tar downloading Archive_Tar-1.3.2.tgz ... Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes) ......done: 17,150 bytes upgrade ok: Archive_Tar 1.3.2
Todo parece estar bien, continuamos con la otra dependencia
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade Console_Getopt downloading Console_Getopt-1.2.3.tgz ... Starting to download Console_Getopt-1.2.3.tgz (4,011 bytes) ....done: 4,011 bytes No handlers for package.xml version 2.0
Del sitio web de PEAR
(Febrero 1, 2007) A partir del 1 de Enero de 2008, PEAR va a dejar de soportar versiones de PEAR menores o iguales a la 1.3.6, por lo que se recomienda que se actualize utilizando estos comandos:
pear upgrade --force PEAR-1.3.6 Archive_Tar-1.3.1 Console_Getopt-1.2 pear upgrade --force PEAR-1.4.11 pear upgrade PEAR
Entonces empezamos con el primer comando
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade --force PEAR-1.3.6 Archive_Tar -1.3.1 Console_Getopt-1.2 downloading PEAR-1.3.6.tgz ... Starting to download PEAR-1.3.6.tgz (106,880 bytes) .........................done: 106,880 bytes downloading Archive_Tar-1.3.1.tgz ... Starting to download Archive_Tar-1.3.1.tgz (15,102 bytes) ...done: 15,102 bytes downloading Console_Getopt-1.2.tgz ... Starting to download Console_Getopt-1.2.tgz (3,370 bytes) ...done: 3,370 bytes upgrade ok: Console_Getopt 1.2 upgrade ok: Archive_Tar 1.3.1 requires package `XML_RPC' >= 1.4.0 PEAR: Dependencies failed
Nos topamos con otra dependencia, la actualizamos
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade XML_RPC downloading XML_RPC-1.5.1.tgz ... Starting to download XML_RPC-1.5.1.tgz (32,215 bytes) .........done: 32,215 bytes upgrade ok: XML_RPC 1.5.1
Intentamos otra vez el primer comando
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade --force PEAR-1.3.6 Archive_Tar -1.3.1 Console_Getopt-1.2 downloading PEAR-1.3.6.tgz ... Starting to download PEAR-1.3.6.tgz (106,880 bytes) .....................done: 106,880 bytes downloading Archive_Tar-1.3.1.tgz ... Starting to download Archive_Tar-1.3.1.tgz (15,102 bytes) ...done: 15,102 bytes downloading Console_Getopt-1.2.tgz ... Starting to download Console_Getopt-1.2.tgz (3,370 bytes) ...done: 3,370 bytes upgrade ok: Console_Getopt 1.2 upgrade ok: Archive_Tar 1.3.1 Optional dependencies: 'xmlrpc' PHP extension is recommended to utilize some features upgrade ok: PEAR 1.3.6
Parece que todo salió bien, ahora vamos con el segundo comando.
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade --force PEAR-1.4.11 downloading PEAR-1.4.11.tgz ... Starting to download PEAR-1.4.11.tgz (283,272 bytes) ...................done: 283,272 bytes Optional dependencies: package `PEAR_Frontend_Web' version >= 0.5.0 is recommended to utilize some feat ures. package `PEAR_Frontend_Gtk' version >= 0.4.0 is recommended to utilize some feat ures. package `PEAR_Frontend_Gtk2' version >= 0.1.0 is recommended to utilize some fea tures. upgrade ok: PEAR 1.4.11
Ok, ahora el tercero y último.
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade PEAR downloading PEAR-1.6.0.tgz ... Starting to download PEAR-1.6.0.tgz (296,465 bytes) .............................................................done: 296,465 bytes requires package `Structures_Graph' >= 1.0.2 PEAR: Dependencies failed
Necesitamos una dependencia mas
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade Structures_Graph downloading Structures_Graph-1.0.2.tgz ... Starting to download Structures_Graph-1.0.2.tgz (30,947 bytes) .........done: 30,947 bytes upgrade ok: Structures_Graph 1.0.2
Reintentamos el último comando recomendado en el sitio web de PEAR
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade PEAR downloading PEAR-1.6.0.tgz ... Starting to download PEAR-1.6.0.tgz (296,465 bytes) .............................................................done: 296,465 bytes Optional dependencies: package `PEAR_Frontend_Web' version >= 0.5.0 is recommended to utilize some feat ures. package `PEAR_Frontend_Gtk' version >= 0.4.0 is recommended to utilize some feat ures. upgrade ok: PEAR 1.6.0
Ahora que ya actualizamos PEAR, intentamos actualizar el paquete DB otra vez
C:\Inetpub\vhosts\webmail\horde\pear>pear upgrade DB downloading DB-1.7.11.tgz ... Starting to download DB-1.7.11.tgz (132,064 bytes) .............................done: upgrade ok: DB-1.7.11
Ahora, en Windows, al utilizar el comando pear, estamos actualizando el pear que esta en:
C:\Program Files\SWsoft\Plesk\Aditional\PleskPHP5\PEAR
Pero nosotros necesitamos actualizar el pear que utiliza el webmail, lo único que hay que hacer, es copiarlo al directorio virtual del webmail o en donde se encuentre el horde.
Copiamos los archivos del folder
C:\Program Files\SWsoft\Plesk\Aditional\PleskPHP5\PEAR
a
C:\Inetpub\vhosts\webmail\horde\pear\PEAR
Despues copiamos el folder
C:\Inetpub\vhosts\webmail\horde\pear\PEAR\DB
a
C:\Inetpub\vhosts\webmail\horde\pear\DB
por ultimo, copiamos los archivos
C:\Inetpub\vhosts\webmail\horde\pear\PEAR\DB.php C:\Inetpub\vhosts\webmail\horde\pear\PEAR\PEAR.php C:\Inetpub\vhosts\webmail\horde\pear\PEAR\pearcmd.php C:\Inetpub\vhosts\webmail\horde\pear\PEAR\System.php
a
C:\Inetpub\vhosts\webmail\horde\pear\DB.php C:\Inetpub\vhosts\webmail\horde\pear\PEAR.php C:\Inetpub\vhosts\webmail\horde\pear\pearcmd.php C:\Inetpub\vhosts\webmail\horde\pear\System.php
Esto nos arregla el error del paquete de la DB en Horde, pero nos deja con un error mas al tratar de entrar al webmail
Warning: include_once(PEAR.php) [function.include-once]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\webmail\horde\lib\core.php on line 45 Warning: include_once() [function.include]: Failed opening 'PEAR.php' for inclusion (include_path='C:\Inetpub\vhosts\webmail\horde\lib ;.;./includes;./pear') in C:\Inetpub\vhosts\webmail\horde\lib\core.php on line 45 Warning: include_once(Log.php) [function.include-once]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\webmail\horde\lib\Horde.php on line 3 Warning: include_once() [function.include]: Failed opening 'Log.php' for inclusion (include_path='C:\Inetpub\vhosts\webmail\horde\lib ;.;./includes;./pear') in C:\Inetpub\vhosts\webmail\horde\lib\Horde.php on line 3 Warning: DataTree_sql::require_once(DB.php) [function.DataTree-sql-require-once]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree \sql.php on line 1620 Fatal error: DataTree_sql::require_once() [function.require]: Failed opening required 'DB.php' (include_path='C:\Inetpub\vhosts\webmail\horde\lib ;.;./includes;./pear') in C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree \sql.php on line 1620
Para arreglar este problema, solo tenemos que editar la linea de include_path en nuestro nuestro php.ini
agregamos: c:/inetpub/vhosts/webmail/horde/pear;
include_path = "c:/inetpub/vhosts/webmail/horde/pear;.;./includes;./pear"
Ahora solo vamos a http://webmail.midominio.com y entramos a Horde sin nigun error.
Referencias
Post original: http://forum.swsoft.com/showthread.php?threadid=45054
Solución en Linux: http://forum.swsoft.com/showthread.php?threadid=32922