I wrote a php script locally on my machine that worked. But when I uploaded it too my ftp server i ran into some issues. Obviously I couldn`t use rename function etc, and had to change to ftp_rename etc. So the problem is that I can't rename or delete any files with my php script. I have tried to change permissions on files and root directory without any luck. I can browse the files, but not rename or delete them. I don't get any error messages either, the file doesn't load and I get a 500 server error if I try to rename or delete. Any suggestions?
$ftp_server = "";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, "username", "password");
$files = ftp_rawlist($ftp_conn, "www/subtitlesyncer/uploads");
ftp_delete($ftp_conn, "www/subtitlesyncer/uploads/newfile.txt")
if (ftp_rename($ftp_conn, "www/subtitlesyncer/uploads/newfile.txt","www/subtitlesyncer/uploads/new_file_edited.txt")) {
...
}
I use this settings, but can`t get any error.
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
This is the file I try to edit:
-rw-r--r-- 1 <username> <username> 130782 Sep 28 14:41 newfile.txt
I did set the permission on folder and subfiles and subfolders to 777 (for testing), but when I create the textfile it gets 644. But I've changed the permissions the textfile to 777 aswell, I still can`t delete it.