Php enable exif extension

Введение

With the exif extension you are able to work with image meta data. For example, you may use exif functions to read meta data of pictures taken from digital cameras by working with information stored in the headers of the JPEG and TIFF images.

Требования

Your PHP must be compiled in with —enable-exif . PHP does not require any additional library for the exif module. Windows users must also have the mbstring extension enabled.

Установка

To enable exif-support configure PHP with —enable-exif

Windows users must enable both the php_mbstring.dll and php_exif.dll DLL’s in php.ini . The php_mbstring.dll DLL must be loaded before the php_exif.dll DLL so adjust your php.ini accordingly.

Настройка во время выполнения

Поведение этих функций зависит от установок в php.ini .

Exif supports automatically conversion for Unicode and JIS character encodings of user comments when module mbstring is available. This is done by first decoding the comment using the specified characterset. The result is then encoded with another characterset which should match your HTTP output.

Таблица 1. Exif configuration options

NameDefaultChangeableChangelog
exif.encode_unicode«ISO-8859-15»PHP_INI_ALLAvailable since PHP 4.3.0.
exif.decode_unicode_motorola«UCS-2BE»PHP_INI_ALLAvailable since PHP 4.3.0.
exif.decode_unicode_intel«UCS-2LE»PHP_INI_ALLAvailable since PHP 4.3.0.
exif.encode_jis«»PHP_INI_ALLAvailable since PHP 4.3.0.
exif.decode_jis_motorola«JIS»PHP_INI_ALLAvailable since PHP 4.3.0.
exif.decode_jis_intel«JIS»PHP_INI_ALLAvailable since PHP 4.3.0.

Краткое разъяснение конфигурационных директив.

exif.encode_unicode defines the characterset UNICODE user comments are handled. This defaults to ISO-8859-15 which should work for most non Asian countries. The setting can be empty or must be an encoding supported by mbstring. If it is empty the current internal encoding of mbstring is used.

exif.decode_unicode_motorola defines the image internal characterset for Unicode encoded user comments if image is in motorola byte order (big-endian). This setting cannot be empty but you can specify a list of encodings supported by mbstring. The default is UCS-2BE.

exif.decode_unicode_intel defines the image internal characterset for Unicode encoded user comments if image is in intel byte order (little-endian). This setting cannot be empty but you can specify a list of encodings supported by mbstring. The default is UCS-2LE.

Читайте также:  Css волнистая линия подчеркивания

exif.encode_jis defines the characterset JIS user comments are handled. This defaults to an empty value which forces the functions to use the current internal encoding of mbstring.

exif.decode_jis_motorola defines the image internal characterset for JIS encoded user comments if image is in motorola byte order (big-endian). This setting cannot be empty but you can specify a list of encodings supported by mbstring. The default is JIS.

exif.decode_jis_intel defines the image internal characterset for JIS encoded user comments if image is in intel byte order (little-endian). This setting cannot be empty but you can specify a list of encodings supported by mbstring. The default is JIS.

Типы ресурсов

Данное расширение не определяет никакие типы ресурсов.

Предопределенные константы

Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение подгружается во время выполнения.

The exif_imagetype() lists several related built-in constants.

Содержание exif_imagetype — Determine the type of an image exif_read_data — Reads the EXIF headers from JPEG or TIFF exif_tagname — Get the header name for an index exif_thumbnail — Retrieve the embedded thumbnail of a TIFF or JPEG image read_exif_data — Alias of exif_read_data()

Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:

Copyright © 2005-2016 Project.Net.Ru

Источник

Php enable exif extension

Не буду рассказывать, что такое «exif в php» — если вы здесь, наверняка знаете функции, которые начинаются с «exif».

Как проверить включен ли модуль у вас на сайте?

Для того, чтобы проверить — «включен ли модуль exif у вас на сайте» или нет нам понадобится:

Возьмем любую функцию с приставкой exif — пусть это будет функция «exif_imagetype»

Ещё нам понадобится функция function_exists.

Проверим определена ли выше означенная функция с условием if, если да, то выводим :

Соберем весь код проверки включенности «exif»

if (function_exists(‘exif_imagetype’))
echo «exif модуль включен»;
>
else
echo «exif модуль не включен»;
>

Возьмем выше приведенный код и поместим прямо здесь на странице:

Результат проверки включенности «exif»

Как видим, что модуль «exif» — работает, но для того, чтобы оно заработало — ранее его «exif»

Где кнопка включения exif

Наша задача — найти кнопку, где это модуль включается!

Для этого нам понадобится(буду показывать на реальном примере моего хостера):

Где кнопка включения exif

Где кнопка включения exif

Включаем exif

После этого ищем строку exif.

Читайте также:  Trimming strings in javascript

Надо поставить галку напротив строки » exif»

Источник

enable exif for php?

is there a relatively simple way to add exif support for php? as far as I can tell, i need to recompile php to support it.. but i’m rather new at that..

and if i did, is there anything i would need to watch out for in terms of keeping php working properly w/ DA?

DirectAdmin Support

Administrator

Download and compile/install exif as per their instructions.

Once that’s done, to add it to php, run the following:

cd /usr/local/directadmin/customapache
#edit the configure.php file and add:
—enable-exif
# to the list of configure commands (make sure there is a \ at the end of each line except the last one)
./build clean
./buid php

sander79

Verified User

Download and compile/install exif as per their instructions.

Once that’s done, to add it to php, run the following:

cd /usr/local/directadmin/customapache
#edit the configure.php file and add:
—enable-exif
# to the list of configure commands (make sure there is a \ at the end of each line except the last one)
./build clean
./build php

I just tried this script and there was one little problem.
At the end the script replaced the httpd.conf file with another one.
My site was not working anymore and the browser asked where to save .php files.
After restoring the old httpd.conf file it worked again.

webbasica

Verified User

chriske21

Verified User

i just needed to added —enable-with-exif to my configure line an configure php again. That did it.
________
CL70

snaaps

Verified User

I have rebuild PHP with —enable-exif and also tried —enable-with-exif
But phpinfo.php does not show the exif extension.

Must I enabled this also in de php.ini file?

Note, I used apache 2.2.15 and PHP 5.2.6 in CGI mode (suphp)

Can anybody help me with these?

SeLLeRoNe

Super Moderator

snaaps

Verified User

Custombuild, apache 2.2.15, PHP5 in CGI mode, PHP4 in CLI mode.

I did edit the file: /usr/local/directadmin/custombuild/configure/ap2/configure.php5 and add the following line:
—enable-exif

Then save the file and rebuild php:
./buid php all
service httpd restart

No errors, but also no exif in phpinfo.phh file..

(why start a new topic if here is a old topic with the same problem?)

SeLLeRoNe

Super Moderator

no problem on add to an old 3d, my question was related just cause, has you correctly mentioned, the configuration file is in different position so i needed to point you into the right position.

Читайте также:  Php write out a file

For what you sayd, everything is correct, i would like suggest you to use ./build php n

The next question is, have you added

into the last line? have you added a / at the end of the line before the last?

dusst

New member

Yes, I’ve added a / to the end before the last line.

but also no exif in phpinfo.php file

SeLLeRoNe

Super Moderator

just to be clear, i wrote the wrong one, a \ is needed and NOT /

Please past your configure.php5

 --enable-zip \ --enable-wddx \ --enable-exif

Or, if you want, i should check your box.

Im also thinkin about you using php as cgi maybe with suphp (right?)

If is correct you have to edit this file:

/usr/local/directadmin/custombuild/configure/suphp/configure.php5
/usr/local/directadmin/custombuild/configure/ap2/configure.php5

dusst

New member

Sorry for my spelling mistake, I used a /. And had configured the file:
/ usr/local/directadmin/custombuild/configure/ap2/configure.php5

But leave it as it was and edit the correct file «/ usr/local/directadmin/custombuild/configure/suphp/configure.php5»

This is the content of the file:

#!/bin/sh "./configure" \ "--prefix=/usr/local/php5" \ "--enable-force-cgi-redirect" \ "--enable-fastcgi" \ "--with-config-file-path=/usr/local/etc/php5/cgi" \ "--with-curl=/usr/local/lib" \ "--with-gd" \ "--with-gettext" \ "--with-jpeg-dir=/usr/local/lib" \ "--with-freetype-dir=/usr/local/lib" \ "--with-kerberos" \ "--with-openssl" \ "--with-mcrypt" \ "--with-mhash" \ "--with-mysql=/usr" \ "--with-mysqli=/usr/bin/mysql_config" \ "--with-pcre-regex=/usr/local" \ "--with-pdo-mysql=/usr" \ "--with-pear" \ "--with-png-dir=/usr/local/lib" \ "--with-zlib" \ "--with-zlib-dir=/usr/local/lib" \ "--enable-zip" \ "--enable-gd-native-ttf" \ "--with-iconv=/usr/local" \ "--enable-bcmath" \ "--enable-calendar" \ "--enable-ftp" \ "--enable-magic-quotes" \ "--enable-sockets" \ "--enable-mbstring" \ "--enable-exif"

I still can not see the EXIF in the phpinfo, I am trying to install «CF Image Host 1.4» but I get only 1 error:

error: Exif extension is not installed.(the script can be used without exif extension installed) http://php.net/manual/en/book.exif.php

In previous responses mentioned run «. / php buid all», I also I run?, because it does not work, I get error only command or file.

dusst

New member

Sorry for the double post, but I can not change the content.
I want to show the Begin of the content of my phpinfo.

System
Linux residentidle.net 2.6.18-194.26.1.el5.028stab079.2 #1 SMP Fri Dec 17 19:25:15 MSK 2010 x86_64

Build Date
Oct 27 2010 07:20:18

Configure Command
‘./configure’ ‘—prefix=/usr/local/php5’ ‘—enable-force-cgi-redirect’ ‘—enable-fastcgi’ ‘—with-config-file-path=/usr/local/etc/php5/cgi’ ‘—with-curl=/usr/local/lib’ ‘—with-gd’ ‘—with-gettext’ ‘—with-jpeg-dir=/usr/local/lib’ ‘—with-freetype-dir=/usr/local/lib’ ‘—with-kerberos’ ‘—with-openssl’ ‘—with-mcrypt’ ‘—with-mhash’ ‘—with-mysql=/usr’ ‘—with-mysqli=/usr/bin/mysql_config’ ‘—with-pcre-regex=/usr/local’ ‘—with-pdo-mysql=/usr’ ‘—with-pear’ ‘—with-png-dir=/usr/local/lib’ ‘—with-zlib’ ‘—with-zlib-dir=/usr/local/lib’ ‘—enable-zip’ ‘—enable-gd-native-ttf’ ‘—with-iconv=/usr/local’ ‘—enable-bcmath’ ‘—enable-calendar’ ‘—enable-ftp’ ‘—enable-magic-quotes’ ‘—enable-sockets’ ‘—enable-mbstring’

Virtual Directory Support
disabled

Configuration File (php.ini) Path
/usr/local/etc/php5/cgi

Loaded Configuration File
/usr/local/etc/php5/cgi/php.ini

Scan this dir for additional .ini files
(none)
additional .ini files parsed
(none)

Zend Memory Manager
enabled

Registered PHP Streams
https, ftps, compress.zlib, php, file, data, http, ftp, zip

Registered Stream Socket Transports
tcp, udp, unix, udg, ssl, sslv3, sslv2, tls

Registered Stream Filters
zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed

Источник

Оцените статью