PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ftp_systype> <ftp_size
Last updated: Fri, 22 Aug 2008

view this page in

ftp_ssl_connect

(PHP 4 >= 4.3.0, PHP 5)

ftp_ssl_connectAbre una conexión segura SSL-FTP

Descripción

resource ftp_ssl_connect ( string $host [, int $puerto [, int $tiempo_espera ]] )

ftp_ssl_connect() abre una conexión SSL-FTP con el host indicado.

Note: Porqué puede que esta función no exista
ftp_ssl_connect() se encuentra disponible únicamente si el soporte para OpenSSL está habilitado en su versión de PHP. Si no está definido y ha compilado el soporte para FTP, entonces ésta es la causa. Para Windows, debe compilar sus propios binarios de PHP para contar con soporte para esta función.

Lista de parámetros

host

La dirección del servidor FTP. Este parámetro no debe tener barras al final, y no debe tener el prefijo ftp://.

puerto

Este parámetro especifica un puerto alterno para conectarse. Si es omitido o se define como cero, entonces el puerto FTP predeterminado, 21, será usado.

tiempo_espera

Este parámetro especifica el tiempo máximo de espera para todas las operaciones de red subsecuentes. Si se omite, el valor predeterminado es 90 segundos. El tiempo de espera puede ser modificado y consultado en cualquier momento con ftp_set_option() y ftp_get_option().

Valores retornados

Devuelve una secuencia SSL-FTP en caso de tener éxito o FALSE si ocurre un error.

Registro de cambios

Versión Descripción
5.2.2 La función fue modificada para devolver FALSE cuando no puede usar una conexión SSL, en lugar de recaer en una no-SSL como lo hacía previamente.

Ejemplos

Example #1 Ejemplo de ftp_ssl_connect()

<?php

// establecer una conexión ssl básica
$id_con ftp_ssl_connect($servidor_ftp);

// iniciar sesión con nombre de usuario y contraseña
$resultado_login ftp_login($id_con$nombre_usuario_ftp$contrasenya_ftp);

echo 
ftp_pwd($id_con); // /

// cerrar la conexión ssl
ftp_close($id_con);
?>

Ver también



ftp_systype> <ftp_size
Last updated: Fri, 22 Aug 2008
 
add a note add a note User Contributed Notes
ftp_ssl_connect
contact dot removethis at deciacco dot com
16-Oct-2007 02:00
For those of you that see this for the first time and might be discouraged from having to compile PHP, please take a look at this page: http://www.deciacco.com/blog/archives/124
none
09-Feb-2005 12:24
I wasted a lot of time trying to get FTP over SSL/TLS working in PHP on Windows OS (with precompiled SSL PHP-packages etc.). However, it never worked for me.

I'm happy I found a nice solution now:
using "MovieIt Freely", a commandline FTP-Client, freeware at http://www.standardnetworks.com.
A nice tool that worked on all SSL/TLS-enabled FTP-Server for me.

Its easy to get it to interact with PHP:
a) Create a temporary batch-txt-file and therein write all your commands to be performed
b) then launch the program with exec() or backticks, let MovieIt read the batch-txt-file and forward/write down the log/results in a temporary results-txt-file
c) Finally read the log/results-txt-file

Check the manual for details.

Hope it helps. Cheers!
philip at php dot net
15-Jul-2004 09:08
Since ftp_ssl_connect() requires SSL compiled into PHP, Windows users will need to compile their own PHP this way or download it from another source.  Here's one such (and trusted) source:
* http://ftp.emini.dk/pub/php/win32/openssl/
moolder at gmx dot net
21-Jan-2004 11:56
Just remember: SSL FTP != SFTP

Differences: an SSL FTP connects on port 990, and you need an ftp server which will support this (seems like none in the SuSE linux distribution do). Even if you get this function to work, and it connects ok to a normal FTP server on port 21, data WILL NOT BE ENCRYPTED. If you don't believe me, go sniff it yourself!

ftp_systype> <ftp_size
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites