 |
ช่วยดูหน่อยครับ ผมแก้ไม่ได้จริง ๆ.....ailed to open stream: Permission denied in |
|
 |
|
|
 |
 |
|
Code
Warning: file_put_contents(/home/aaa/domains/xxx/public_html/games/prequota56/uploads/profileimg/1258897948.jpg) [function.file-put-contents]: failed to open stream: Permission denied in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 10
Warning: getimagesize() [function.getimagesize]: Unable to access /home/aaa/domains/xxx/public_html/games/prequota56/uploads/profileimg/1258897948_r.jpg in /home/aaadomains/xxx/public_html/games/prequota56/download.php on line 25
Warning: getimagesize(/home/aaa/domains/xxx/public_html/games/prequota56/uploads/profileimg/1258897948_r.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 25
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: Unable to access uploads/profileimg/1258897948_r.jpg in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 36
Warning: imagecreatefromjpeg(uploads/profileimg/1258897948_r.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 36
Warning: imagecopymerge(): supplied argument is not a valid Image resource in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 39
Warning: imagepng() [function.imagepng]: Unable to open 'uploads/useapp/201207191557515KvTg57.png' for writing: Permission denied in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 40
Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/aaa/domains/xxx/public_html/games/prequota56/download.php on line 42
Code (PHP)
require "config.inc.php";
require "class/Image.php";
require "facebook_lib/facebook.php";
require "fb.inc.php";
$imgsn = date("YmdHis").random_char(7);
$img = file_get_contents('https://graph.facebook.com/'.$fbuser->id.'/picture?type=large');
$file = dirname(__file__).'/uploads/profileimg/'.$fbuser->id.'.jpg';
file_put_contents($file, $img);
@chmod(dirname(__file__)."/uploads/profileimg/{$fbuser->id}.jpg", 0777);
$srcFile = dirname(__file__)."/uploads/profileimg/{$fbuser->id}.jpg";
$destPath = dirname(__file__)."/uploads/profileimg/";
$image = new Image();
$image->sizelimit_x = 130;
$image->sizelimit_y = 130;
$image->keep_proportions = true;
if($image->resize_image($srcFile) === true) {
$image->save_resizedimage($destPath, "{$fbuser->id}_r");
}
@chmod(dirname(__file__)."/uploads/profileimg/{$fbuser->id}_r.jpg", 0777);
$image->destroy_resizedimage();
$profile_size = getimagesize(dirname(__file__)."/uploads/profileimg/{$fbuser->id}_r.jpg");
if($profile_size[0]>150) {
$width = 150;
$height = 150;
} else {
$width = $profile_size[0];
$height = $profile_size[1];
}
$pos_left = floor((400/2) - ($width/2));
$pos_top = floor((400/2) - ($height/2));
$dest = imagecreatefromjpeg("uploads/show.jpg");
$src = imagecreatefromjpeg("uploads/profileimg/{$fbuser->id}_r.jpg");
imagealphablending($dest, false);
imagesavealpha($dest, true);
$img = imagecopymerge($dest, $src, $pos_left, $pos_top, 0, 0, $width, $height, 100);
imagepng($dest,"uploads/useapp/{$imgsn}.png");
imagedestroy($dest);
imagedestroy($src);
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2012-07-19 16:00:57 |
By :
l3alLkisS |
View :
2095 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไป Set permission ให้เป็น 777 นะครับ
|
 |
 |
 |
 |
Date :
2012-07-19 16:29:08 |
By :
adaaugusta |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้แล้วก็เหมือนเดิมครับ
|
 |
 |
 |
 |
Date :
2012-07-19 16:43:45 |
By :
l3alLkisS |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้ว Folder ดังกล่าว มันมีอยุ่จริงหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2012-07-19 17:10:35 |
By :
adaaugusta |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีครับ
|
 |
 |
 |
 |
Date :
2012-07-19 17:22:54 |
By :
l3alLkisS |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมว่าไม่ใช่ล่ะ
จาก Error ที่ให้มาน่ะเกิดจาก 2 ปัญหา
1. permission ทำให้เขียน อ่าน กระทำการใดๆกับไฟล์ หรือ โฟลเดอร์ได้
2. พาธ หรือ ไฟล์ที่อ้างถึงไม่มีอยุ่จริง
ถ้าคุณบอกสองข้อนี้ถูกต้องหมด งั้นก็น่าจะลงแล้วนะครับ
ว่าแต่ผมยังข้องใจว่า "/home/aaa/domains/xxx/public_html/games/prequota56/uploads/profileimg/"
มันมีอยุ่จริงๆหรือเปล่า
ลอง Capture รูป พาธ มาให้ดูหน่อย
และก็ลอง Capture รูป Permission ที่เซตไว้มาให้ดูหน่อยครับ
|
 |
 |
 |
 |
Date :
2012-07-19 17:28:02 |
By :
adaaugusta |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|