?
Solved

directory/file access for apache 2 on winxp pro

Posted on 2003-02-25
22
Medium Priority
?
181 Views
Last Modified: 2012-05-04
im running apache 2 with php4 on windows xp pro... i used to use ms iis 5 webserver and they allowed me to do directory read/write access.. i have a php script that requires a text file to be writable.. is there a way to make a single file or directory writable (or chmod 777 equivalent)? i've searched all over the net and couldnt find any topics on this.....
0
Comment
Question by:yingjai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 10
22 Comments
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8023931
just check the security permission of the directory and add everyone with full permission there and while writing mention full path to the file and do same for the permission of the file.

Harry
0
 

Author Comment

by:yingjai
ID: 8029552
lol.. i kinda got lost after the 'add everyone with full permission' part...
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8031492
lost where its simple what problem you are facing now

harry
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:yingjai
ID: 8032115
i am trying to configure file permission/folder permission on windows xp for apache2 webserver... if i do the "add everyone with full permission" to the folder, isnt that only for iis?
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8032153
no no you have to do it from the windows explorer right click on the directory and then click property then security this will solve your problem


Harry
0
 

Author Comment

by:yingjai
ID: 8038523
in the folder properties, i only see 3 tabs... general, sharing, and customize
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8040497
I guess that the folder is in FAT32 partation so you will not able to see the permission tab and for FAT32 there should not be any problem for access denied thing what error are you getting while running your script and you post the code here.

or try this in httpd.cong

<Directory your directory path>
     Order Deny,Allow
     Allow from all
 </Directory>
Harry
0
 

Author Comment

by:yingjai
ID: 8045276
what does this line do anyways?
"    Order Deny,Allow"
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8046568
this tells tells the order suppose A user belong to group GA and GA has deny to directory c:\www and user A also belong to group GB and GB is allowed to directory c:\www so now the order plays part that user A is denied to access directory c:\www as order deny has first then allow

Harry
0
 

Author Comment

by:yingjai
ID: 8056236
wait.. should i put
    Order Allow,Deny
instead? because im trying to make the folder writable...
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8056313
yes go ahead and also give me the code through which you are trying to write file.

Harry
0
 

Author Comment

by:yingjai
ID: 8061036
this code was found in a php website.. one of those cut and paste scripts...

<?php
// ################  Edit Variables     ######################

$datfile = "shout.txt";
// This is the name of text file where all
// the text is stored.

// Simply include this file where yo want
// the text to appear in your page.
/* example:  include("shout.txt")  */
// see test.php and the readme for further help.


$MAX_LENGTH = 35;
// This is the max length of the user's entry.  you should
// also make your input box's maxlength the same number or smaller
//  Basically this is just for error checking and to make sure
// the script was called from the page, not by itself.


$NUM_COMMENTS = 10;
// Make this bigger to show more  or smaller to show less.

/* NOTE:  There is no max length for the NAME, if you so desire one,
simply limit the amount of characters that one can enter in the field. */

// #############  DO NOT EDIT BELOW THIS LINE  ################

if (!$name)
{ $name = ">>"; }
else $name .= ":";

$c = preg_replace("/</","&lt;",$c);
$c = preg_replace("/>/","&gt;",$c);

$comfile = file($datfile);
if ($c != "") {
if (strlen($c) < $MAX_LENGTH) {
$fd = fopen ($datfile, "w");
$c = stripslashes($c);
fwrite ($fd, "<div style='width:112px; overflow:hidden'><i>$name</i> $c</div>\n");
for ($i = 0; $i < $NUM_COMMENTS; $i++) {
fwrite ($fd, $comfile[$i]);
}
}
fclose($fd);
}
Header("Location: $HTTP_REFERER");
?>
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8062645
This code works perfect with me. But I have NTFS and the file is having everyone full permission. Not able to understand what the cause check that file is not readonly. and the httpd.conf directive help you?

Harry
0
 

Author Comment

by:yingjai
ID: 8063146
lol.. i think i need detailed instructions from installing php (getting the codes in httpd.conf) to getting the script to run... because im having a hard time.. i moved the website directory to c:/ to make it easier.. but it seemed the same... (c:/ is my ntfs partition).. if it is possible, i want to move my website back to d:/ (fat32)
0
 

Author Comment

by:yingjai
ID: 8063153
i format my computer alot and everytime, i forget to back up sumthing from my c:/
0
 
LVL 5

Accepted Solution

by:
harwantgrewal earned 200 total points
ID: 8063179
I suggest you to work in NTFS its good. make a small parttion for you work and make it NTFS and work on it.

harry
0
 

Author Comment

by:yingjai
ID: 8069835
should i set the whole new partition to full control for everyone?
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8069891
no need just make c for install d for backup or dump and e for development just from in NTFS not need to change to permissions okay. just make all the installation then just change permission for the folder where you want to write the file.

Harry
0
 

Author Comment

by:yingjai
ID: 8070433
so you mean uncheck everything for permissions for everyone?
0
 
LVL 5

Expert Comment

by:harwantgrewal
ID: 8070470
no need to change any permission after formating or converting to NTFS leave it untouch.

Harry
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question