Page 1 of 1

[solved]Xampp file/directory permissions

PostPosted: 16. October 2012 13:01
by JiminSA
Without willingly wanting to get someone to correct my PHP code (see thread at http://community.apachefriends.org/f/viewtopic.php?f=16&t=50665 - don't know how to insert link using the forum CMS) I have come across a situation where xampp does not allow a file to be created on open in php - i.e. with this statement:- $handle = fopen($filename,'w+'); the error message produced is...
Warning: fopen(backup/dbbackup_16.10.2012_13:57:40_all.sql) [function.fopen]: failed to open stream: Invalid argument in C:\xampp\htdocs\MMM\CMS\backup.php on line 115

When I upload and run from the server, everything is fine (the non-existent file is created).
Has it to do with file permissions within Xampp?

Re: Xampp file/directory permissions

PostPosted: 16. October 2012 17:20
by Altrea
Hi JiminSA (there is ALWAYS time for a short salutation, especially if you are asking for help on a volunteer community board. It's a matter of politeness),

JiminSA wrote:with this statement:- $handle = fopen($filename,'w+'); the error message produced is...
Warning: fopen(backup/dbbackup_16.10.2012_13:57:40_all.sql) [function.fopen]: failed to open stream: Invalid argument in C:\xampp\htdocs\MMM\CMS\backup.php on line 115

Which is absolutely correct. The colon is not allowed in Windows filenames.

best wishes,
Altrea

Re: Xampp file/directory permissions

PostPosted: 17. October 2012 06:59
by JiminSA
Brilliant - Thanks loads, Altrea!