creating an image in php, display works, saving to file does not

前端 未结 4 1901
一整个雨季
一整个雨季 2020-12-06 05:56

I am creating an image via a php script using imagepng. This works fine and displays well on the website. even saving-as gives me a valid .png file

header( \         


        
4条回答
  •  借酒劲吻你
    2020-12-06 06:19

    Are you sure the relative path is correct? That can be a bit confusing if that script is called from another script.

    You could try to change the path to:

    $save = $_SERVER['DOCUMENT_ROOT'] . "/sigs/" . strtolower($name) . ".png";
    

    Edit: And of course check the return value of imagepng() and your error log

提交回复
热议问题