Здравствуйте,На Freebsd 11.2 потребовалось установить PHP 5.6 с определенными библиотеками.
Тк данной версии нет в портах, скачал с сайта оф. php исходники и ставил с них.
Все установилось, однако мой скрипт ни в какую не видит GD (PHP GD lib is NOT installed. Ask admin to install it. )
при этом с консоли вродебы ок:
# php -v
PHP 5.6.40 (cli) (built: Aug 23 2019 03:23:06)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader v10.3.8, Copyright (c) 2002-2019, by ionCube Ltd.# php -m |grep gd
gd# php -i |grep gd
Configure Command => './configure' '--prefix=/usr/local/php56' '--disable-all' '--with-pcre-regex' '--with-mysql=/usr/local' '--with-mysqli' '--enable-pdo' '--enable-json' '--with-pdo_mysql' '--with-zlib' '--with-freetype-dir=/usr/local' '--enable-session' '--enable-libxml' '--enable-xml' '--enable-fileinfo' '--with-gd' '--enable-bcmath' '--enable-dom' '--enable-sysvshm' '--enable-posix' '--enable-ctype' '--enable-sockets' '--enable-hash' '--enable-filter' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-curl' '--with-mcrypt' '--with-pdo-mysql' '--enable-zip' '--with-libzip' '--enable-mbstring'
gd
gd.jpeg_ignore_warning => 0 => 0Пробовал запускать скрипт, который рисует синий квадрат с помощью этой библиотеки - все ок(рисует).
в phpinfo тоже показывает что библиотека есть:
gd
GD Support enabled
GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.10.1
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
libPNG Version 1.6.37+apng
WBMP Support enabled
XBM Support enabled
При этом этот же скрипт без ошибок ставится и работает на centos7 с php56, установленной из remi.В чем может быть проблема и почему вроде бы установленный скрипт не видит GD?
upd: при выполнении make test в каталоге с исходниками не проходит ни одного теста:=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 31
---------------------------------------------------------------------Number of tests : 330 308
Tests skipped : 22 ( 6.7%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 308 ( 93.3%) (100.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 25 seconds
==========================================================================================================================================
FAILED TEST SUMMARYimagecreatefrompng() and empty/missing file [tests/001.phpt]
Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) [tests/bug19366.phpt]
Bug #22544 (TrueColor transparency in PNG images). [tests/bug22544.phpt]
Bug #24155 (gdImageRotate270 rotation problem). [tests/bug24155.phpt]
Bug #24594 (Filling an area using tiles). [tests/bug24594.phpt]
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color) [tests/bug27582_1.phpt]
Bug #28147 (Crash with anti-aliased line) [tests/bug28147.phpt]
Bug #36697 (TrueColor transparency with GIF palette output). [tests/bug36697.phpt]
Bug #37346 (gdimagecreatefromgif, bad colormap) [tests/bug37346.phpt]
Bug #37360 (gdimagecreatefromgif, bad image sizes) [tests/bug37360.phpt]
Bug #38112 (GIF Invalid Code size ). [tests/bug38112.phpt]
Bug #38179 (imagecopy from a palette to a truecolor image loses alpha channel) [tests/bug38179.phpt]
Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters) [tests/bug38212.phpt]
Bug #39082 (Output image to stdout segfaults). [tests/bug39082.phpt]
Bug #37360 (gdimagecreatefromgif, bad image sizes) [tests/bug39273.phpt]
Bug #39508 (imagefill crashes with small images 3 pixels or less) [tests/bug39286.phpt]
Bug #39366 (imagerotate does not respect alpha with angles>45) [tests/bug39366.phpt]
Bug #39508 (imagefill crashes with small images 3 pixels or less) [tests/bug39508.phpt]
Bug #39780 (PNG image with CRC/data error raises a fatal error) [tests/bug39780.phpt]
Bug #40764 (line thickness not respected for horizontal and vertical lines) [tests/bug40764.phpt]
Bug #41442 (imagegd2() under output control) [tests/bug41442.phpt]
Bug #42434 (ImageLine w/ antialias = 1px shorter) [tests/bug42434.phpt]
Bug #43073 (TrueType bounding box is wrong for angle<>0) [tests/bug43073.phpt]
Bug #43121 (gdImageFill with IMG_COLOR_TILED crashes httpd) [tests/bug43121.phpt]
Bug #43475 (Thick styled lines have scrambled patterns) [tests/bug43475.phpt]
Bug #43828 (broken transparency of imagearc for truecolor in blendingmode) [tests/bug43828.phpt]
Bug #44849 (imagecolorclosesthwb is not available on Windows) [tests/bug44849.phpt]
Bug #45799 (imagepng() crashes on empty image). [tests/bug45799.phpt]
Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) [tests/bug48555.phpt]
Bug #48732 (TTF Bounding box wrong for letters below baseline) [tests/bug48732.phpt]
Bug #48801 (Problem with imagettfbbox) [tests/bug48801.phpt]
Bug #49600 (imageTTFText text shifted right) [tests/bug49600.phpt]
Bug #50194 (imagettftext broken on transparent background w/o alphablending) [tests/bug50194.phpt]
Bug #51263 (imagettftext and rotated text uses wrong baseline) [tests/bug51263.phpt]
Bug #51671 (imagefill does not work correctly for small images) [tests/bug51671.phpt]
Bug #53154 (Zero-height rectangle has whiskers) [tests/bug53154.phpt]
Bug #53156 (imagerectangle problem with point ordering) [tests/bug53156.phpt]
Bug #53504 imagettfbbox/imageftbbox gives incorrect values for bounding box [tests/bug53504.phpt]
Bug #53640 (XBM images require width to be multiple of 8) [tests/bug53640.phpt]
Bug #60160 (imagefill does not work correctly for small images) @see bug51671 [tests/bug60160.phpt]
....
> --prefix=/usr/local/php56нестандартненько
подсказка: а ты рантайм-линкеру (ld.so) об этом как сказал (rpath||ld.so.conf) ?
Тебе же там написало Ask admin to install it.
>[оверквотинг удален]
> GIF Read Support enabled
> GIF Create Support enabled
> PNG Support enabled
> libPNG Version 1.6.37+apng
> WBMP Support enabled
> XBM Support enabled
гм.. вот чет я не вижу включенной потдержки jpeg. У вас наверно в php-скрипте есть функция проверяющая установлены ли компоненты для работы именно jpeg. Но вместо сообщения о том что нет потдержки именно jpeg, оно пишет что нет gd. У меня такое было на каком то фреймворке (с png файлами). Причем писало именно что не установлено gd. А когда в код полез проверять там именно что проверялась работа с png.
Вот щас специально пересобрал в докере контейнер (убрав jpeg), получил такой же вывод как у вас. в общем на своей centos7 еще раз вывод посмотрите, я уверен там будет упоминание jpeg
В общем вот такой вывод должен быть (у вас еще нет упоминания о FreeType Support а в тестах вроде как бы на него есть намеки)
GD Support enabled
GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.9.1
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.6.36
WBMP Support enabled
XBM Support enabled
ой.. про freetype просмотрел
Чето я вывод теста посмотрел и у меня сомнения появились. Кусок бы кода php который ошибку выводит.
Добрый день,большое вам спасибо, действительно было:
php -r 'var_dump(gd_info());'
...
["JPEG Support"]=>
bool(false)
...Пересобрал gd
./configure --with-jpeg-dir=/usr/local/libИ все заработало.
>[оверквотинг удален]
> гм.. вот чет я не вижу включенной потдержки jpeg. У вас наверно
> в php-скрипте есть функция проверяющая установлены ли компоненты для работы именно
> jpeg. Но вместо сообщения о том что нет потдержки именно jpeg,
> оно пишет что нет gd. У меня такое было на каком
> то фреймворке (с png файлами). Причем писало именно что не установлено
> gd. А когда в код полез проверять там именно что проверялась
> работа с png.
> Вот щас специально пересобрал в докере контейнер (убрав jpeg), получил такой же
> вывод как у вас. в общем на своей centos7 еще раз
> вывод посмотрите, я уверен там будет упоминание jpeg