chmod permissions

jaynevada

New Member
Hi everyone,

I'm trying to figure out why my image script won't work on the vps server. For some reason it won't write the correct chmod permissions to a directory for the user. For example when a user signs up the script creates a folder for that user inside a folder named images. Now the images folder is set to 777 permissions and the user folder is suppose to be set to the same. Here's the part of php code that addes the new user folder to the images folder.

Code:
[SIZE=1]if( $userid != 0 ){[/SIZE]
[SIZE=1]mkdir($this->ace->config->image_folder.$username);[/SIZE]
[SIZE=1]chmod($this->ace->config->image_folder.$username, 0777);[/SIZE]
[SIZE=1]mkdir($this->ace->config->thumb_folder.$username);[/SIZE]
[SIZE=1]chmod($this->ace->config->thumb_folder.$username, 0777);[/SIZE]
[SIZE=1]if( @file_exists(dirname(__FILE__).'/blank.htm') ){[/SIZE]
[SIZE=1]@copy(dirname(__FILE__).'/blank.htm', $this->ace->config->image_folder.$username.'/index.htm');[/SIZE]
[SIZE=1]@copy(dirname(__FILE__).'/blank.htm', $this->ace->config->thumb_folder.$username.'/index.htm');[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]return $userid;[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]}[/SIZE]
[SIZE=1]return 0;[/SIZE]

Anyone else run into this. Or is it just me. :confused:

Regards,
Jay
 
Hi

A couple of questions for you...

1) You say that the permissions aren't changed to 777 - what are the permissions being changed to? Are the directories' perms being changed at all or are they maintaining the umask?

2) Without seeing more of the script, I can't see if there is a problem with the snippet that you posted. Has this script ever worked for you on another server or hosting environment?

3) Is php being executed as suEXEC?

4) Do you have enabled php open_basedir protection?

5) What do your logs say? Is php spewing forth any error/debug messages? Do you have php set to display errors and/or log them (php.ini):

error_reporting = E_ALL
display_errors = On (this should be "Off" for production servers)
log_errors = On

Some more info would help.
 
How did you resolve?

Hi Jay;
I want to know how did you resolve this?
I have the same problem.

Thanks,
George
 
Top