can't open a file
| From: | Ken Tozier | Date: | Mon, 23 Jul 2007 04:23:48 +0000 |
| Subject: | can't open a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-259356@lists.php.net to get a copy of this message | ||
Hi
I'm trying to create/open a file for write in a subfolder of the folder that contains my PHP script but am having no luck.
Here's the relevant code
$oldPath = '/test/old_page_'.$oldRecord['page_number'].'.txt';
$oldHand = fopen($oldPath, "w+");
if ($oldHand === true)
fwrite($oldHand, $oldData);
else
die('Failed to open file "'.$oldPath.'" for writing!');
fclose($oldHand);
The permissions for the "test" folder is set to me in a WebServer subfolder on Mac OS X. Do I need to set permissons to something else to get this to work? If so, what permissions should I use?
Thanks for any help
Ken