apache本身不支持FTP,但是,可以通過apache+PHP來支持FTP,具體內容參考PHP的手冊。 以下例子來自於該手冊。 例子 1. FTP example <?php // set up basic connection $conn_id = ftp_connect($ftp_server);
// login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; }
// upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
// check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; }
// close the FTP stream ftp_close($conn_id); ?>
注意for windows 的PHP 4.2.6直接支持FTP, 而for UNIX的版本需要在編譯、安裝時 加 --enable-ftp option when installing PHP 4 or --with-ftp when using PHP 3 問題:Can't connect to MySQL server on 'localhost' (10061)?
我打開apache friends 時,點擊phpMyAdamin時不能打開,會出現下面的提示, 為什麼?Welcome to phpMyAdmin 2.5.1 Error MySQL said: Can't connect to MySQL server on 'localhost' (10061)