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.