使用GD2函數在照片上添加文字出現錯誤~

來源:互聯網
上載者:User
出現這樣的錯誤怎麼解決啊,試了好多辦法都不行。!



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



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



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



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



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


回複討論(解決方案)

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 開啟失敗:沒有這樣的檔案或目錄

提示圖片不存在,擷取不到圖片資源,接下來都報錯了
檢查下檔案路徑

我的路徑是正確的,我只是搞不明白為什麼我在DreamWeaver可以正常運行代碼,在ZendStudio卻不行。

用IDE運行會有偏差的,還是用瀏覽器運行吧。瀏覽器運行沒問題就行。

問題解決啦。好像是檔案目錄的許可權問題。我的php網頁如果在圖片目錄層級之上,就可以。但如果在同一層級或者低於圖片目錄層級,就載入不了。~謝謝各位了。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.