I worked with FTP upload from my php page.
<?php error_reporting(E_ALL); ini_set('display_errors', true); flush(); $ftp_server = "myserver"; $ftp_user_name="myuser"; $ftp_user_pass="mypass"; $remote_file="myfile.txt"; $file="myfile.txt"; // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); ?>
This gives me a warning in the browser, for example
Warning: ftp_put(): Access is denied. in /var/www/html/ftpcheck.php on line 17. There was a problem while uploading myfile.txt.
I checked the file permissions. But its available. Can someone tell me why this is happening?
source share