Jump to content

MacOS, Permissions, local Apache servers, headaches, etc.


joshuadbooth

Recommended Posts

Ok... here's the setup

I'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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.