PHP::GD->;imagepng()don';我不能保存这个文件

PHP::GD->;imagepng()don';我不能保存这个文件,php,gd,image,Php,Gd,Image,我在服务器上使用GD Imagepng()时遇到问题。我的代码在本地计算机上运行良好,正确创建文件,正确保存,但不能在服务器上运行 我看了很多帖子,尝试了很多东西都没有成功。 所有GD元素都已启用。如果我直接在页面中输出图片而不尝试保存它,它会工作,但一旦我尝试保存它,它就不再工作了。“自定义”文件夹的权限设置为777。我的php文件编码为id ANSI 这是我的密码: function random($car) { $string = ""; $chaine = "abcdef

我在服务器上使用GD Imagepng()时遇到问题。我的代码在本地计算机上运行良好,正确创建文件,正确保存,但不能在服务器上运行

我看了很多帖子,尝试了很多东西都没有成功。 所有GD元素都已启用。如果我直接在页面中输出图片而不尝试保存它,它会工作,但一旦我尝试保存它,它就不再工作了。“自定义”文件夹的权限设置为777。我的php文件编码为id ANSI

这是我的密码:

function random($car) {
    $string = "";
    $chaine = "abcdefghijklmnpqrstuvwxy1234567890";
    srand((double)microtime()*1000000);
    for($i=0; $i<$car; $i++) {
        $string .= $chaine[rand()%strlen($chaine)];
    }
    return $string;
}


$pathPictures = Array();
$pathSmall = "images/custom/pure/166x250/";
$pathMid = "images/custom/pure/464x700/";
$pathBig = "images/custom/pure/1770x2668/";
array_push($pathPictures, $pathSmall, $pathMid, $pathBig);

$sizes=Array('166x250', '464x700' ,'1770x2668');
$colorRGB = explode(',', str_replace(array('rgb(', ')'), '', $_POST["selectedColor"]));

$selectedPictures = Array();
array_push($selectedPictures, $_POST["selectedStringerImg"]);
array_push($selectedPictures, $_POST["selectedGraphicImg"]);
array_push($selectedPictures, $_POST["selectedFinsFuturesLeftImg"]);
array_push($selectedPictures, $_POST["selectedFinsFuturesCenterImg"]);
array_push($selectedPictures, $_POST["selectedFinsFuturesRightImg"]);
array_push($selectedPictures, $_POST["selectedFinsFCSImg"]);
array_push($selectedPictures, "mask-pure.png");

$pixName = random(25);

for($a=0;$a<=2;$a++){
    $size = explode('x', $sizes[$a]);
    $x=$size[0];
    $y=$size[1];
    $final_img = imagecreatetruecolor($x, $y);
    $color = imagecolorallocatealpha($final_img, $colorRGB[0], $colorRGB[1], $colorRGB[2], 0);
    imagefill($final_img, 0, 0, $color);

    foreach($selectedPictures as $pix){
     $image = imagecreatefrompng($pathPictures[$a].$pix);
     imagecopy($final_img, $image, 0, 0, 0, 0, $x, $y);
        imagealphablending($image, false);
        imagesavealpha($image, true);
    };
    imagepng($final_img, $pathPictures[$a].'custom/'.$pixName.'.png');
};
echo $pathSmall.'custom/'.$pixName.'.png';
随机函数($car){
$string=“”;
$chaine=“abcdefghijklmnpqrstuvwxy1234567890”;
srand((双)微时间()*1000000);

对于($i=0;$i),custom/的相关子目录中的文件权限是否也设置为777?仅在custom/上设置它们是不够的。(顺便说一句,777权限使用起来总是很危险的,尽管它对测试很有用。)那么你在屏幕上或日志中看到了什么错误呢?我也有同样的问题。没有错误,日志中没有任何内容。