Steven Matthews
Steven Matthews

Reputation: 11285

How can I fix "Permission Denied" on ftp_put() in php?

I'm getting permission denied messages when I try to upload a file:

Warning: ftp_put() [function.ftp-put]: Can't open that file: Permission denied in /home/kirby/public_html/members/upload_advanced.php on line 48

The file already exists, how do I enable ftp_put() to overwrite it.

Also, here's the upload code:

$upload = ftp_put($conn_id, "www/logos/web_".$row[username].".jpg",
                                  "../logos/web_" . $row[username] . ".jpg",  FTP_BINARY);

Upvotes: 3

Views: 10044

Answers (1)

Yurii Sherbak
Yurii Sherbak

Reputation: 126

To enable write access you have to edit the /etc/vsftpd.conf file and uncomment the

#write_enable=YES

line, so it should read

write_enable=YES

Save the file and restart vsftpd with sudo service vsftpd restart. https://askubuntu.com/a/410962

Upvotes: 2

Related Questions