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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -