Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
AD Gallery 60
SyntaxHighlighte... 51
Newsletters v4.03 112
Facebook Like Box 130
Newsletters v4.02 58
Metro 165
Facebook Connect 171
Shoutbox Panel 128
Redactor for PHP... 107
MI Floating Side... 109
Facebook Login/R... 154
Avatar Studio v2.03 180
Relationship Sta... 98
Sexual Orientati... 116
Fisherman 144
Popular Addons
iTheme2 5807
Arise 5793
User Control v1.23 4622
Event Calendar 4052
Photowidget panel 3888
Radio-Theme red2... 3358
Highslide Gallery 3315
CSS/JavaScript D... 3234
Facebook Connect... 2987
Dynamic Menu 2894
Slideshow Lightb... 2723
L-AMANT 2659
Enigma 2637
2Dark 2607
Black 2580
View Thread
Who is here? 1 guest(s)
 Print Thread
Server sets CHMOD 600 on files instead 644
Kamillo
I'm testing v7 on my hosting's server. Gallery does not show thumbnails. It seems that php-fusion creates thumbs with CHMOD 600 instead of 644. After diggging in Polish support it seem the problem is bad server configuration (functions creating files).

http://7.khaman.n...album_id=1 One thumbnail was corrected manually to 644 and works.

If it is true, how can I convince my host admin that this is not problem of php-fusion but server configuration? The first answer was like:

Every sript works with user right, webxxx and files created by PHP script get webxxx rights, so there is no problem with chmod 600, photo should work. There is nothing we can correct on server.


Who is right? If not the host, how can I show / prove he is wrong?
------------------------------
PHP-Fusion PL Crew | My Site
 
http://www.khaman.pl
Wooya
This is code responsible for photos uploading in v7:
		if (is_uploaded_file($_FILES['photo_pic_file']['tmp_name'])) {
$photo_types = array(".gif",".jpg",".jpeg",".png");
$photo_pic = $_FILES['photo_pic_file'];
$photo_name = str_replace(" ", "_", strtolower(substr($photo_pic['name'], 0, strrpos($photo_pic['name'], "."))));
$photo_ext = strtolower(strrchr($photo_pic['name'],"."));
$photo_dest = PHOTODIR;
if (!preg_match("/^[-0-9A-Z_\.\[\]]+$/i", $photo_name)) {
$error = 1;
} elseif ($photo_pic['size'] > $settings['photo_max_b']){
$error = 2;
} elseif (!in_array($photo_ext, $photo_types)) {
$error = 3;
} else {
$photo_file = image_exists($photo_dest, $photo_name.$photo_ext);
move_uploaded_file($photo_pic['tmp_name'], $photo_dest.$photo_file);
chmod($photo_dest.$photo_file, 0644);
$imagefile = @getimagesize($photo_dest.$photo_file);
if ($imagefile[0] > $settings['photo_max_w'] || $imagefile[1] > $settings['photo_max_h']) {
$error = 4;
unlink($photo_dest.$photo_file);
} else {
$photo_thumb1 = image_exists($photo_dest, $photo_name."_t1".$photo_ext);
createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb1, $settings['thumb_w'], $settings['thumb_h']);
if ($imagefile[0] > $settings['photo_w'] || $imagefile[1] > $settings['photo_h']) {
$photo_thumb2 = image_exists($photo_dest, $photo_name."_t2".$photo_ext);
createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb2, $settings['photo_w'], $settings['photo_h']);
}
}
}
}

As you can see in line #16 we're setting up file CHMOD to 644 so that's not PFv7 issue.
PHP-Fusion DEV Team
It's not a bug, it's undocumented feature...
 
Kamillo
Does it mean that any script creating any file with chmod 644 will fail? Do you know any simple php script I can try and prove it to host admin? I'm not very good in php.
------------------------------
PHP-Fusion PL Crew | My Site
 
http://www.khaman.pl
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
can i use a raspberry pi web server System Administration 17 15-01-2013 17:35
PHP-Fusion on an internal server Installation Issues 7 22-12-2012 14:28
cs server panel Panels and Infusions 9 19-11-2012 12:08
Make a Server Licensing and Copyright Questions 2 10-10-2012 10:53
(Green) Phos Theme PSD-files needed. Themes Support 2 07-06-2012 15:04
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue