I could create file with php fopen(..) when I used the ubuntu 12.04. But now I can't create file with php, because I pass ubuntu 14.04. I can open existing file to read or to write. But I can't create new file because of permission denied.
fopen(../../../../../Desktop/file): failed to open stream: Permission denied in /var/www/html/createFolder.php on line 17
Cannot open file: ../../../../..//Desktop/file" error is occured.
$my_file = ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "home" . DIRECTORY_SEPARATOR . "username" . DIRECTORY_SEPARATOR . "Desktop" . DIRECTORY_SEPARATOR . "file";
$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);
$data = 'New data line 1';
fwrite($handle, $data);
$new_data = "
".'New data line 2';
fwrite($handle, $new_data);