Jump to content

Creating folders using PHP code [problem]


abdullahc

Recommended Posts

OS: Redhat

host: Rackspace

PHP version 5.1

framework: codeigniter

 

 

we are trying to create folders for users to upload photos etc for signed up users.

below is the code we are using. Could this be a code issue, we have checked the server folder CHMODs

Your thoughts are appreciated and we thank you in advance.

 

1.  we've used chmod -R 0777 users from SSH so that the users directory is writable from script.

2. When someone registers, say with username of phpmaster, a folder is created in the users directory with 0777 permission from code

3. On the subsequent line, another directory is created within users/phpmaster named photo with 0777 permission, from code

 

In the 3rd step the folders are not created at this moment. Here is the code:

 

mkdir($this->config->item('base_path') . '/users/' . $userInfo['username'], 0777);

mkdir($this->config->item('base_path') . '/users/' . $userInfo['username'] . '/photo', 0777);

Link to comment
Share on other sites

well you dont need to specific 0777 since that is teh default.  what error message?  if its not working then it has to be throwring a message of some sort.  did you echo out the value of $this->config->item('base_path') . '/users/' . $userInfo['username'] to make sure that is actually the correct place?

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.