PHP에서 gd로 이미지 출력하기, Bitnami WAMP, Windows 10? 파일로 만들 수는 있지만 출력이되지 않습니다.Bitnami WAMP, Windows 10에서 gd로 이미지를 출력하는 방법은 무엇입니까?
파일이 없기 때문에 오류가 발생합니다. http://localhost/type705b/public/index.php/test/img11.
호스트 (public/index.php/test/img11) 다음의 매개 변수는 컨트롤러 작업에 액세스하는 데 사용됩니다. 실제 파일은
어쩌면 내가 .htaccess
를 수정하고 이미지 지원을 활성화해야 /type705b/src/Bundle/Resources/views/test/img/ImageOutputingError.php
Options -MultiViews
Options -Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /public/
IndexIgnore *
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{ENV:REQUEST_FILENAME} !-d
RewriteCond %{ENV:REQUEST_FILENAME} !-f
RewriteCond %{ENV:REQUEST_FILENAME} !-l
RewriteRule ^index.php?(.+)$ index.php?url=$1 [QSA,L]
이 이미지는, "이 오류를 포함하고 있기 때문에 이미지 http://localhost/type705b/public/index.php/test/img11, 표시 할 수 없습니다"파이어 폭스에서 오류가 발생하고, 탐색기에서 십자가와 작은 사각형을 표시 크롬과 오페라에 표시되지 않습니다.
경위는이 마크 업을 (내가 IMG || 오류 "|| 몸을 만든) 코드로 표시합니다 보여줍니다
|| body style="margin: 0px; background: #0e0e0e;">
|| img style="-webkit-user-select: none;background-position: 0px 0px, 10px 10px;background-size: 20px 20px;background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);" src="http://localhost/type705b/public/index.php/test/img11">
</body>
배경 이미지가 난 내 스크립트에서 사용하는 어떤 색상이 없습니다
: # 0000FF].
ImageOutputingError.php
$width = 150;
$height = 150;
$img = imagecreate($width, $height);
//Create image background
//$white = ImageColorAllocate($img, 255, 255, 255);
//$black = ImageColorAllocate($img, 0, 0, 0);
//$red = ImageColorAllocate($img, 255, 0, 0);
$blue = imagecolorallocate($img, 0, 0, 255);
ImageFill($img,$width,$height,$blue);
header('Content-type: image/gif');
imagegif($img);
imagedestroy($img);
imagecolordeallocate($img, $blue);
ImageCreatingWorking.php
012,327,834,714,748 번들/* * 용은 phpinfo()
PHP 버전 5.6.30 < ...>
GD 지원
GD 버전을 활성화 (호환 2.1.0)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.7.0
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 9 compatible
PNG Support enabled
libPNG Version 1.5.26
WBMP Support enabled
XPM Support enabled
libXpm Version 30411
XBM Support enabled
WebP Support enabled
*/
감사합니다. 'ImageOutputingError.php'를 localhost 디렉토리에 놓고 직접 URL localhst/ImageOutputingError.php를 사용합니다 -이 방법이 효과적입니다. 자체 프레임 워크 작업에 포함시키는 경우에만 작동합니다.대부분의 헤더는 잘못 보내지 만 어딘가에는 이미지가 표시되지 않습니다. –