[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Не работает gd
Гость_Алексей
Здравствуйте!

Как подключить графическую библиотеку.

в php.ini раскоментировал строку extension=php_gd2.dll
прописал путь к extension_dir="C:/Program Files/PHP/ext/";

но проблемма остается.
Вот скрипт, который я использую:

$
f="kart/Фото_71.jpg";

$razmer=getimagesize($f,$picture);
$picture[1]="Космическая туманность";
$pust=imagecreatetruecolor(130,100);
$img=imagecreatefromjpeg($f);
imagecopyresampled($pust,$img,0,0,0,0,130,100,$razmer[0],$razmer[1]);
imagejpeg($pust,$min);
imagedestroy($pust);
imagedestroy($img);
$mm=basename($f,".jpg");
print_r("<a href=$f target='_blank'>img src='$min' border=0 alt='$mm'></a><br>$mm<br>$razmer[3]<br>$pictyre[1]<br><br>");


Выдает ошибку: Fatal error: Call to undefined function imagecreatetruecolor()

Система Xp sp3



Спустя 47 минут, 11 секунд (22.10.2010 - 12:58) sergeiss написал(а):
Цитата (Гость_Алексей @ 22.10.2010 - 13:11)
прописал путь к extension_dir="C:/Program Files/PHP/ext/";

Попробуй так:
extension_dir="C:/Program Files/PHP/ext";

Спустя 54 минуты, 37 секунд (22.10.2010 - 13:53) Гость_Алексей написал(а):
Все равно не работает.

Спустя 18 минут, 39 секунд (22.10.2010 - 14:11) Michael написал(а):
А сам файл php_gd2.dll есть в этой папке?
Апач перезапускал?

Спустя 30 минут, 33 секунды (22.10.2010 - 14:42) Гость_Алексей написал(а):
Файл есть и апач перезапускал.

Такое впечатление, что php.ini вообще не используется. Пробовал даже удалять его из директории windows; работает без него, если использую imagecreatetruecolor() - выдает ошибку.

Спустя 3 минуты, 1 секунда (22.10.2010 - 14:45) Michael написал(а):
Выполни команду phpinfo() и посмотри что там касательно этой библиотеки.

php.ini не надо удалять. Он кстати в папке где стоит и PHP ?

Спустя 5 минут, 7 секунд (22.10.2010 - 14:50) sergeiss написал(а):
Цитата (Michael @ 22.10.2010 - 15:45)
Выполни команду phpinfo() и посмотри что там касательно этой библиотеки.

Гость_Алексей - и заодно там же посмотри, какой ИНИ-файл используется smile.gif Скорее всего, у тебя берётся файл из каталога, где ПХП установле и поэтому его надо редактировать.

Спустя 8 минут, 18 секунд (22.10.2010 - 14:58) Гость_Алексей написал(а):
Сначала php.ini был в папке с php, потом переместил его в папку windows т.к. когда запускаю
 phpinfo()
там указано, что файл конфигурации в папке windows. Касательно библиотеки Gd нашел только одну строку:
cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"

Спустя 17 минут, 46 секунд (22.10.2010 - 15:16) sergeiss написал(а):
Цитата (Гость_Алексей @ 22.10.2010 - 15:58)
там указано, что файл конфигурации в папке windows.

Ты "копи-пейст" сделай и результат покажи smile.gif У меня, например, есть такие строки, идут подряд:
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\PHP\php.ini
И реально работает инишник из каталога ПХП.

Спустя 20 минут, 48 секунд (22.10.2010 - 15:37) Michael написал(а):
В начале файла php.ini написано как он ищется. Первым - в папке php. Если нет его там, то в других местах ... cool.gif

Спустя 13 минут (22.10.2010 - 15:50) Guest написал(а):
Только что обнаружил, оказывается у меня после

Configuration File (php.ini) Path C:\WINDOWS
стоит строка Loaded Configuration File (none).


Спустя 8 минут, 28 секунд (22.10.2010 - 15:58) Гость_Алексей написал(а):
PHP Version 5.2.4

System Windows NT MICROSOF-96E5AC 5.1 build 2600
Build Date Aug 30 2007 07:05:48
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File (none)
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

Спустя 2 минуты, 35 секунд (22.10.2010 - 16:01) Michael написал(а):
а в той папке где стоит php - есть файл php.ini или нет?

Спустя 4 минуты, 23 секунды (22.10.2010 - 16:05) Гость_Алексей написал(а):
php.ini есть.

Спустя 36 минут, 14 секунд (22.10.2010 - 16:42) Гость_Алексей написал(а):
с php.ini разобрался, оказывается в апач в параметре phpdir был указан другой каталог чем тот в котором находился php.ini.

Но проблема осталась, теперь ошибок не выдаёт и показывает пустую страницу.
в phpinfo() новых строк не добавилось.

Спустя 4 минуты, 1 секунда (22.10.2010 - 16:46) sergeiss написал(а):
Может и глупый вопрос... Ты в итоге апач рестартанул после всех этих действий?

И еще. Винда какая стоит?

Спустя 8 минут, 33 секунды (22.10.2010 - 16:54) Гость_Алексей написал(а):
Конечно рестартанул, винда XP sp3.

У меня в php.ini есть две строки с extension_dir, я указал в обоих одинаковый путь. Может они имеют разный смысл? И еще может нужно ставить двойные слеши при написании пути к ext.

Спустя 17 часов, 43 минуты, 13 секунд (23.10.2010 - 10:37) Гость_Алексей написал(а):
в php.errors.log пишет:

[23-Oct-2010 11:20:38] PHP Warning: PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:38] PHP Warning: PHP Startup: exif: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:38] PHP Warning: PHP Startup: gd: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: mysqli: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: openssl: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: PDO_ODBC: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: sockets: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: tidy: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:39] PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:40] PHP Warning: PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:40] PHP Warning: PHP Startup: exif: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:40] PHP Warning: PHP Startup: gd: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:40] PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: mysqli: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: openssl: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: PDO_ODBC: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: sockets: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: tidy: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
[23-Oct-2010 11:20:41] PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0

я так понимаю модули расширения не совпадают с пхп?
Но устанавливал все из одного дистрибутива.

Пхп 5.4.2.

Спустя 2 часа, 21 минута, 14 секунд (23.10.2010 - 12:59) Гость_Алексей написал(а):
Переустановил пхп gd подключилась, но при использовании imagecreatetruecolor() выводится страница с нечитаемыми символами.

Может кто знает?
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.