Problema com função exif_imagetype()

Enviada por Denis Marchi 
Denis Marchi
Problema com função exif_imagetype()
21 de November de 2010 às 07:56AM
Estou usando a função da seguinte forma:
<?php
if (exif_imagetype('image.gif') != IMAGETYPE_GIF) {
echo 'The picture is not a gif';
}
?>

O resultado é: Fatal error: Call to undefined function exif_imagetype()

Estou usando Windows XP e Wamp server.
pesquisei em http://php.net/manual/pt_BR/function.exif-imagetype.php
e vi uma mensagem assim:

Windows users: If you get the fatal error "Fatal error: Call to undefined function exif_imagetype()", and you have enabled php_exif.dll, make sure you enable php_mbstring.dll. You must put mbstring before exif in the php.ini, i.e.:

extension=php_mbstring.dll
extension=php_exif.dll

You can check whether this has worked by calling phpinfo() and searching for exif.

Abri o php.ini e alterei a posição:
Ficou assim:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
extension=php_mbstring.dll
extension=php_exif.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_ming.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11g Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_phar.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll

Alguém pode me ajudar pois ainda não funciona a função?
Sou iniciante em PHP.
Obrigado pela ajuda.
Denis Marchi
Re: Problema com função exif_imagetype()
21 de November de 2010 às 10:06AM
Ok. Resolvi.
Desinstalei e instalei o Wamp server novamente.
Alterei para extension=php_mbstring.dll ficar acima de extension=php_exif.dll
Desta vez funcionou.
Eu devo ter feito algo errado na troca anterior por isso dava erro.
Realmente o erro era as posições das dlls no php.ini.
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.