joshuadbooth Posted July 13, 2006 Share Posted July 13, 2006 Ok... here's the setupI'm on a Mac Powerbook with OS 10.4 with php enabled in the local webserver. I can go to http://127.0.0.1/phptests and successfully run php files. Here is my dilemma: I'm trying to get a phpscript to write to a local file using fwrite("folders.txt", $folder); The problem is it always gives me an error, saying it can't write to the file. I have absolutely no idea what to do now. If I upload all the necessary files to the web, it works fine. I tried entering a chmod command but it won't let me do that. Any suggestions on how to get this to work locally?here's my code: the $folder variable gets its info from a flash movie, and works correctly. It just won't write locally. [code]<?php$folder= $_POST['folder'];$filename = "folders.xml";$fh = fopen($filename, "w") or die("can't open file");fwrite($fh, $folder);fclose($fh);?>[/code] Link to comment https://forums.phpfreaks.com/topic/14515-macos-permissions-local-apache-servers-headaches-etc/ Share on other sites More sharing options...
ShogunWarrior Posted July 13, 2006 Share Posted July 13, 2006 [code]<?phpecho(is_writeable("folders.xml"));[/code]Tell us the result, if it's 1 then the file should be able to be written to, if nothing is displayed then proper permissions are not there. Link to comment https://forums.phpfreaks.com/topic/14515-macos-permissions-local-apache-servers-headaches-etc/#findComment-57611 Share on other sites More sharing options...
joshuadbooth Posted July 13, 2006 Author Share Posted July 13, 2006 that's the problem... it's registering a 0 for is_writable when on my local host, and 1 when it's on the remote host. I need to figure out how to get it to work on the local host. Link to comment https://forums.phpfreaks.com/topic/14515-macos-permissions-local-apache-servers-headaches-etc/#findComment-57622 Share on other sites More sharing options...
ShogunWarrior Posted July 13, 2006 Share Posted July 13, 2006 I know nothing about Mac, can you access the folder/file visually and see if there's a Read-Only or equivalent setting. Sometimes I had the problem on my local Windows install and so I found it was set Read-Only. Link to comment https://forums.phpfreaks.com/topic/14515-macos-permissions-local-apache-servers-headaches-etc/#findComment-57624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.