Why PHP GD library fails to write images on my disk? -
i wrote piece of php (test.php) code this
$width = 300; $height = 200; $im = imagecreatetruecolor($width,$height); $mypic = imagecolorallocate($im,100,30,125); imagefill($im,0,0,$mypic); imagepng($im,'./mypic.png'); imagepng($im); imagedestroy($im);
when run on ubuntu command line (php test.php), works fine , writes mypic.png on disk. however, when access test.php on remote client (chrome), shows picture correctly, program fails write images on disk.
try running chown -r www-data:www-data /var/www
assuming /var/www/ site directory. or make file writing have write permissions.
Comments
Post a Comment