An error occurred while adding text to the photo using the GD2 function ~

Source: Internet
Author: User
An error occurred while adding text to the photo using the GD2 function ~ How can this problem be solved? I tried a lot of methods .!



Warning: Imagecreatefromjpeg (/images/photo.jpg): failed to open stream: No such file or directory in C: \ Apache24 \ htdocs \ Excerse \ index. phpOn line 3



Warning: Imagecolorallocate () expects parameter 1 to be resource, boolean given in C: \ Apache24 \ htdocs \ Excerse \ index. phpOn line 4



Warning: Imagettftext () expects parameter 1 to be resource, boolean given in C: \ Apache24 \ htdocs \ Excerse \ index. phpOn line 7



Warning: Imagejpeg () expects parameter 1 to be resource, boolean given in C: \ Apache24 \ htdocs \ Excerse \ index. phpOn line 8



Warning: Imagedestroy () expects parameter 1 to be resource, boolean given in C: \ Apache24 \ htdocs \ Excerse \ index. phpOn line 9


Reply to discussion (solution)

Warning: imagecreatefromjpeg (/images/photo.jpg): failed to open stream: No such file or directory in C: \ Apache24 \ htdocs \ Excerse \ index. php on line 3

Failed to open stream: No such file or directory

The system prompts that the image does not exist. If the image resource cannot be obtained, an error is reported.
Check the file path

My path is correct. I just don't understand why I can run the code normally in DreamWeaver, but not in ZendStudio.

There may be deviations when running with IDE, so use a browser to run it. The browser can run normally.

Solve the problem. It seems that the permission of the file directory is a problem. If my php webpage is above the image directory level, you can. But it cannot be loaded if it is at the same level or below the image directory level .~ Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.