我不能用PHP8创建图像 <?php header("Content-Type: image/png"); I try to create image with php8 with imagecreate funct

我不能用PHP8创建图像 <?php header("Content-Type: image/png"); I try to create image with php8 with imagecreate funct,php,image,Php,Image,我不能用PHP8创建图像 <?php header("Content-Type: image/png"); I try to create image with php8 with imagecreate function but it doesn't work here is my code // Create the size of image or blank image $image = imagecreate(500,500);

我不能用PHP8创建图像

<?php
   header("Content-Type: image/png");
   I try to create image with php8 with imagecreate function but it doesn't work here is my code
   // Create the size of image or blank image
   $image = imagecreate(500,500);
  
   // Set the background color of image
   $background_color = imagecolorallocate($image, 0, 153, 0);
  
   // Set the text color of image
   $text_color = imagecolorallocate($image, 255, 255, 255);
  
   // Function to create image which contains string.
   imagestring($image, 5, 180, 100,  "GeeksforGeeks", $text_color);
   imagestring($image, 3, 160, 120,  "A computer science portal", $text_color);
  

  
    imagepng($image);
    imagedestroy($image);

 
    
?>