$handle = fopen('/Applications/XAMPP/xamppfiles/htdocs/test/file.txt', 'w');
[function.fopen]: failed to open stream: Permission denied in
/Applications/XAMPP/xamppfiles/htdocs/test/index.php on line 26.
Maybe, you have no premissions to acces the file. One of the answet, is that, you must change
CHMOD to e.g.
777. You can co it with your ftp explorer or with PHP.