[英]Warning: imagejpeg() [function.imagejpeg]: Unable to open 'broadcast_news_images/13331558akantony2.jpg' for writing: Permission denied in
[英]Warning: imagejpeg() [function.imagejpeg]: Unable to open [filename] for writing: No such file or directory
我無法弄清楚為什么我在嘗試使用imagejpeg()保存圖像時收到此錯誤
下面是我的代碼的摘錄,我已經刪除了任何無關的東西,並保持足夠產生錯誤。 路徑肯定存在,並且權限設置為777。
$url = "http://website.com";
$filename = 'imagename';
$filepath = $url."/Images/accents/generated/".$filename.".jpg";
$base = imagecreatefromjpeg($url.'/images/'.$filename);
$imagewidth = imagesx($base);
$imageheight = imagesy($base);
$new = imagecreatetruecolor($imagewidth, $imageheight);
imagecopy($new, $base, 0, 0, 0, 0, $imagewidth, $imageheight);
imagejpeg($new, $filepath);
imagedestroy($new);
`
這可能是因為您嘗試輸出到url
而不是本地文檔...
你的輸出路徑:
http://website.com/Images/accents/generated/imagename.jpg
這不起作用...輸出必須是本地的,嘗試類似於:
./Images/accents/generated/imagename.jpg
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.