ftp_exec

(PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8)

ftp_execFTP sunucusunda bir komut çalıştırma isteği yapar

Açıklama

ftp_exec(resource $ftp, string $komut): bool

FTP sunucusuna belirtilen SITE EXEC komutu için istek gönderir.

Değiştirgeler

ftp

FTP bağlantısının bağlantı tanıtıcısı.

komut

Çalıştırılacak komut.

Dönen Değerler

İşlem başarılı olursa (sunucu yanıt kodu 200 ise) true olmazsa false döner.

Örnekler

Örnek 1 - ftp_exec() örneği

<?php

// değişken ilklendirmesi
$komut 'ls -al >files.txt';

// temel bağlantıyı kuralım
$conn_id ftp_connect($ftp_server);

// Kullanıcı adı ve parola ile oturum açalım
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// komutu çalıştıralım
if (ftp_exec($conn_id$komut)) {
    echo 
"$komut sorunsuzca çalıştırıldı\n";
} else {
    echo 
"$komut çalıştırılamadı\n";
}

// bağlantıyı kapatalım
ftp_close($conn_id);

?>

Ayrıca Bakınız

  • ftp_raw() - Bir FTP sunucusuna bir komut gönderir

add a note add a note

User Contributed Notes 1 note

up
1
sam at totallydigital dot co dot nz
20 years ago
A word of caution, execution via FTP isn't very widely supported.  Check that it works on the servers that you intend to connect to before you start coding something that requires this.
To Top