Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-20-2004, 05:16 PM   PM User | #1
Michiel
Regular Coder

 
Join Date: Jul 2002
Location: The Netherlands
Posts: 252
Thanks: 0
Thanked 0 Times in 0 Posts
Michiel is an unknown quantity at this point
mkdir() and file permissions

Hi there,

I'm having some troubles with the mkdir function and the file permissions. I've got the following code in my script:

PHP Code:
mkdir($this->_aConfig['path'], 0644); 
This is supposed to create a new directory that is readible and writeble for the php-script itself. So I want to be able to create files and sub-derictories inside this newly created directory.

The directory is in fact being made. However the file permissions appear to be 550 (according to WS-FTP). So the script is not allowed to write in the directory ....

Can anyone tell me how I should change the code, for it to work?

Thanx in advance! Michiel
Michiel is offline   Reply With Quote
Old 03-22-2004, 02:56 AM   PM User | #2
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,942
Thanks: 7
Thanked 82 Times in 81 Posts
firepages will become famous soon enough
can't see why the mode changes unless its something sneaky your host does ?

regardless try chmodding to something wide open..

PHP Code:
<?
mkdir
($dir,0777);
?>
create any files or folders you want, then lock it up.
<?
chmod
($dir,0644);
?>
now that is no more likely to work as your original ,butwho knows ?
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 03-22-2004, 06:12 AM   PM User | #3
mr_ego
Regular Coder

 
Join Date: Jun 2002
Location: Brisbane, Australia
Posts: 181
Thanks: 1
Thanked 0 Times in 0 Posts
mr_ego is an unknown quantity at this point
i've had some problems with the chmod() function. so try:

mkdir($this->dirname);
system("chmod 777 " $this->dirname);
__________________
-mR_eGo
_______________________
Programming since
3 years old.
mr_ego is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 AM.


Advertisement
Log in to turn off these ads.