I am having a big issue with a website that must go live as soon as possible....
The customer is uploading images and he permissions are 600.
But i defined in modx
new_file_permissions: 644
new_folder_permissions: 755
I had contact with the hosting provider and they said that they are running suPHP
(i am a developper, so i don’t know this hosting stuff)
On my own hosting account everything works fine...
Could anyone help??
Is modx incompatible with suPHP or could this be resolved???
-
☆ A M B ☆
- 24,524 Posts
If you’re a developer for the web, you’d better learn about "this hosting stuff"; it’s part of working on the web.
http://www.zzee.com/solutions/unix-permissions.shtml
suPHP means they’re using an Apache module that switches user (the su part) from the webserver user (apache, www, or nobody, depending on how the server is configured) to the owner of the .php file. The owner is usually the same user as the FTP user. This way you don’t have to have any files or folders set with world-writable permissions so that the .php scripts can upload or edit files.
Different servers have things configured differently; they may require certain permissions on files and folders to help prevent "others" from accessing "your" files and folders.
You don’t say exactly how the customer is uploading these images.
What snippet are you using to upload the images?
-
☆ A M B ☆
- 24,524 Posts
BobRay, it’s an "image" type TV. Hmmm. That’s using MCPuk. It uses (or tries to) the file permissions set in the Configuration to set the permissions for the newly-moved uploaded file. If that’s not working, then something is either overriding it or blocking the change.
(move_uploaded_file($_FILES['NewFile']['tmp_name'],($this->real_cwd."/$filename($i).$ext"))) {
@chmod(($this->real_cwd."/$filename($i).$ext"),$this->fckphp_config['modx']['file_permissions']); //modified for MODx
You can see what these permissions should be in your site’s cache file:
$c[’new_file_permissions’] = "0644";
$c[’new_folder_permissions’] = "0755";
I looked in the file:
htdocs/core/cache/config.cache.php
and found the following:
’new_folder_permissions’ => ’0755’,
’new_file_permissions’ => ’0644’,
so that seems ok...
Any other ideas???
-
☆ A M B ☆
- 24,524 Posts
Then something in the server or PHP configuration is overriding or blocking the attempt to change the permission of the uploaded file.
I believe that the original permission of the temporary file (the one that gets uploaded, then moved) is 0600; the move_uploaded_file will maintain that setting, then the next line should be modifying the permissions. That obviously is not happening.
i have the same problem.
the owner is set to apache instead of my ftp account name.
i have some stuff running on Joomla and the problem was fixed by setting ftp user and password in administration... is there something in ModX, or it uses different algorithms?