473,698 Members | 2,439 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 2120
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
1789
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
16393
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
1903
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
3621
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
1608
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
3572
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
9634
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
1777
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
2317
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
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
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
7741
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
5867
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
4372
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
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.