CentOS instalar Php Pear Mail

Para hacer un poco de experimento con gaseosa tengo que probar de enviar mails via php a través de mi SMTP (un plesk con qmail). Para esto necesito algunas cosas. Haremos la instalación de componentes via PEAR

“PEAR is a framework and distribution system for reusable PHP components”

Vamos primero a ver que tenemos en PEAR

Listamos componentes PEAR

# pear list
Installed packages, channel pear.php.net:
=========================================
Package        Version State
Archive_Tar    1.3.1   stable
Console_Getopt 1.2     stable
PEAR           1.4.9   stable
XML_RPC        1.5.0   stable

Vemos que evidentemente nos falta el componente MAIL, vamos a ello.

Instalamos Mail via PEAR

# pear install Mail-1.2.0
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail requires PEAR Installer (version >= 1.5.6), installed version is 1.4.9
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.4.1)
No valid packages found

El primer “warning” se fija ejecutando justo el comando que nos dice

# pear channel-update pear.php.net
Retrieving channel.xml from remote server
Update of Channel "pear.php.net" succeeded

El segundo

# pear install --alldeps Mail
pear/Mail requires PEAR Installer (version >= 1.5.6), installed version is 1.4.9
downloading Net_SMTP-1.6.1.tgz ...
Starting to download Net_SMTP-1.6.1.tgz (13,164 bytes)
.....done: 13,164 bytes
downloading Net_Socket-1.0.10.tgz ...
Starting to download Net_Socket-1.0.10.tgz (5,429 bytes)
...done: 5,429 bytes
downloading Auth_SASL-1.0.6.tgz ...
Starting to download Auth_SASL-1.0.6.tgz (9,119 bytes)
...done: 9,119 bytes
install ok: channel://pear.php.net/Auth_SASL-1.0.6
install ok: channel://pear.php.net/Net_Socket-1.0.10
install ok: channel://pear.php.net/Net_SMTP-1.6.1

Seguimos

# pear upgrade pear

pear/PEAR dependency package "pear/Console_Getopt" downloaded version 1.3.1 is not the recommended version 1.2.3, but may be compatible, use --force to install
pear/Archive_Tar requires PEAR Installer (version >= 1.5.4), installed version is 1.4.9
pear/Console_Getopt requires PEAR Installer (version >= 1.8.0), installed version is 1.4.9
downloading Structures_Graph-1.0.4.tgz ...
Starting to download Structures_Graph-1.0.4.tgz (30,318 bytes)
.........done: 30,318 bytes
downloading XML_Util-1.2.1.tgz ...
Starting to download XML_Util-1.2.1.tgz (17,729 bytes)
...done: 17,729 bytes

Warning: Parameter 3 to PEAR_Task_Replace::validateXml() expected to be a reference, value given in PEAR/PackageFile/v2/Validator.php on line 1069
upgrade ok: channel://pear.php.net/XML_Util-1.2.1
upgrade ok: channel://pear.php.net/Structures_Graph-1.0.4

Nos da algunos avisos, si hacemos “pear list” vemos que todavía sigue en la 1.4.9. Utilizamos el parámetro –force

# pear upgrade --force pear
 pear upgrade --force pear
warning: pear/PEAR dependency package "pear/Console_Getopt" downloaded version 1.3.1 is not the recommended version 1.2.3
warning: pear/Archive_Tar requires PEAR Installer (version >= 1.5.4), installed version is 1.4.9
warning: pear/Console_Getopt requires PEAR Installer (version >= 1.8.0), installed version is 1.4.9
downloading PEAR-1.9.4.tgz ...
Starting to download PEAR-1.9.4.tgz (296,332 bytes)
.............................................................done: 296,332 bytes
downloading Archive_Tar-1.3.11.tgz ...
Starting to download Archive_Tar-1.3.11.tgz (18,537 bytes)
...done: 18,537 bytes
downloading Console_Getopt-1.3.1.tgz ...
Starting to download Console_Getopt-1.3.1.tgz (4,471 bytes)
...done: 4,471 bytes
upgrade ok: channel://pear.php.net/Console_Getopt-1.3.1
upgrade ok: channel://pear.php.net/Archive_Tar-1.3.11
upgrade ok: channel://pear.php.net/PEAR-1.9.4
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
To install use "pear install pear/PEAR#featurename"

Ahora ya si que si. Versión 1.9.4.

Ahora procedemos a instalar

# pear install --alldeps Mail
downloading Mail-1.2.0.tgz ...
Starting to download Mail-1.2.0.tgz (23,214 bytes)
........done: 23,214 bytes
install ok: channel://pear.php.net/Mail-1.2.0 

Por un blog he leído que también hará falta esto

# pear install Mail_mime
downloading Mail_Mime-1.8.7.tgz ...
Starting to download Mail_Mime-1.8.7.tgz (31,837 bytes)
.........done: 31,837 bytes
install ok: channel://pear.php.net/Mail_Mime-1.8.7

Links
http://inderpreetsingh.com/2011/02/10/fix-pearmail-due-to-centos-repos-using-old-pear/

Leave a Reply

Your email address will not be published. Required fields are marked *