473,802 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PLEASE HELP: How to create files and folders running my script????

Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
..htaccess file which contains some permissive directives?

Thanks
Jerry
Jul 17 '05 #1
3 2128
Jerry wrote:
Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR) : Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?

Thanks
Jerry


mkdir(TESTDIR, 777); * replace 777 with the correct permissions.

http://www.php.net/manual/en/function.mkdir.php

I think your problem would be more to do with the permissions you are trying to create the folder in. If it's Apache on linux, the user "nobody" will need correct permissions, to be able to write to the directory. You will need to do a CHMOD on the directory. .htaccess file will not fix this as pache doesn't even have the right to write.

J.
Jul 17 '05 #2
Jerry wrote:
Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?


You need to change the permissions of the directory that you want to make
files or directories in to be writeable by all users (ie 0777 or rwxrxwrxw)

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #3
In article <e7************ *************** *****@4ax.com>,
Jerry <su*********@ly cos.com> wrote:
Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?


Nope, apache's web server doesn't do this. Sorry.

You're running as the web server UID and don't have permissions to write
in that directory. Fix the directory's permissions accordingly.

Or create a perl/php script and run it as _your_ UID using cgiwrap

http://cgiwrap.sourceforge.net/

If you don't have root or can't get your webmaster to setup cgiwrap for
you, you'll have to rethink your approach.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1794
by: Tank | last post by:
I have had this post up here when i was trying to figure out how to make leading zeros and have been able to fudge that to work. I am now have trouble getting the loop that makes the folders to start fresh after the .jpg section of the move images code. this will be essential to make the whole thing work. Please help. Even if you just write out the solution. I am beggin. I am desperate. Please help. <!DOCTYPE HTML PUBLIC...
36
16453
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC path with a FSO: Set myFile = Server.CreateObject("Scripting.FileSystemObject").GetFile("\\server2\myshare\myfile.txt") this fails with an Permission Denied. here's the deal:
5
1908
by: Praveen | last post by:
I have script files embedded as resources in my dll. During runtime, I would like to write it out into the app dir (or a app sub-dir) and send the appropriate virtual path to the client. This makes deploying my dll much easier - just a single dll, not having to worry about deploying script files. However, the runtime doesn't seem have enough permissions to write out to the app dir (or any of it's subdir), by default. The folder where I...
13
3633
by: Siegfried Heintze | last post by:
I refered the engineer at my hosting service to http://support.microsoft.com/default.aspx?scid=kb;en-us;825738 where he tried to follow the directions there. He said there was no such file: Document settings\ServerName\ASPNET\Local settings\Temp I said it must be a typo, they meant to say c:\Documents And Settings\Server Name\ASPNET\Local settings\temp.
5
1615
by: Tiraman | last post by:
Hi , i have the A.dll in my GAC (only one occurrence) and after i deleted it from the GAC i saw that it still working . so i did IISRESET and now it throw an error . can we define the time out that the dll stay in the memory ? lets say that if no one access the dll for 60 sec it will be removed from the memory and only in the next time
2
3578
by: Good Man | last post by:
Hi there folks I've got an interesting little problem going on. On one of my projects, I have users log in to retrieve files. The files themselves are stored outside of the www directory on the server, so the only way they can be downloaded is for PHP to stream them to the user. My problem is that my downloads are always "completing" too soon, and always around 1.6 -> 1.9 MB. So, when I try to download a 50MB file, I'm told that...
1
9661
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
7
1787
by: rn5a | last post by:
This is the second time I am asking this question in this newsgroup since I haven't got a solution or response from anyone in my previous post & I need to resolve this issue desperately. Sorry for the double post but I just didn't have any other option other than re-posting the same question in this newsgroup. Consider the following code in a VB class file: Namespace LoginUserFetchDB Public Class ZForZebra : Inherits SoapHeader
8
2322
by: inFocus | last post by:
Hello, I am new to python and wanted to write something for myself where after inputing two words it would search entire drive and when finding both names in files name would either copy or move thoe files to a specified directory. But couple of attempts did not work as desired this is one of them. Could someone help fix it or maybe give a better example.
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.