Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] php-5.0.5-r5 "--with-mime-magic"?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Leprechaun
n00b
n00b


Joined: 04 Oct 2003
Posts: 49
Location: Minnesota, USA

PostPosted: Thu Feb 02, 2006 4:22 am    Post subject: [SOLVED] php-5.0.5-r5 "--with-mime-magic"? Reply with quote

I recently upgraded to dev-lang/php-5.0.5-r5, the version currently in "stable." I've been going through my site, reworking code to fit the new version. I've been getting an error that the mime_content_type function is undefined. After looking at the PHP Mimetype page (http://us2.php.net/mime_magic), I found that php >= 4.3.2 needs to be compiled with the "--with-mime-magic" option in order to define this function. At least, that's how I read it.

Here is an emerge -pv of php:

Code:

oliver backups # emerge -pv dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] dev-lang/php-5.0.5-r5  -adabas -apache +apache2 -bcmath +berkdb -birdstep +bzip2 -calendar -cdb -cgi -cjk +cli +crypt -ctype -curl -curlwrappers -db2 +dba -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp +gd -gd-external +gdbm -gmp -hardenedphp -hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc +ipv6 -java-external -kerberos -ldap -libedit -mcve -memlimit +mhash -ming -mnogosearch -msql -mssql +mysql -mysqli +ncurses +nls -oci8 -oci8-instant-client -odbc -oracle7 -ovrimos -pcntl +pcre -pdo-external -pfpro -pic -posix -postgres -qdbm +readline -recode -sapdb -sasl +session -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid +spell -spl -sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy +tiff -tokenizer +truetype -wddx +xml -xmlrpc -xpm -xsl -yaz -zip +zlib 0 kB

Total size of downloads: 0 kB


I've looked through the USE flags using equery, but nothing mentions mime. Here is the result of phpinfo():

Code:

System    Linux oliver 2.6.12-gentoo-r9 #1 SMP Sat Dec 17 22:53:11 CST 2005 i686
Build Date    Feb 1 2006 19:59:19
Configure Command    './configure' '--prefix=/usr/lib/php5' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar' '--disable-ctype' '--without-curl' '--without-curlwrappers' '--disable-dbase' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filepro' '--disable-ftp' '--with-gettext' '--without-gmp' '--without-hwapi' '--without-iconv' '--without-informix' '--without-kerberos' '--enable-mbstring' '--with-mcrypt' '--disable-memory-limit' '--with-mhash' '--without-ming' '--without-mnogosearch' '--without-msql' '--without-mssql' '--with-ncurses' '--without-oci8' '--without-oci8-instant-client' '--without-oracle' '--with-openssl' '--with-openssl-dir=/usr' '--without-ovrimos' '--disable-pcntl' '--without-pfpro' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--disable-sockets' '--disable-spl' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--without-tidy' '--disable-tokenizer' '--disable-wddx' '--without-xmlrpc' '--without-xsl' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--with-gdbm' '--without-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-tiff-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-mysql=/usr/lib/mysql' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--without-mysqli' '--with-readline' '--without-libedit' '--without-mm' '--without-sqlite'
Server API    Apache 2.0 Handler
Virtual Directory Support    disabled
Configuration File (php.ini) Path    /etc/php/apache2-php5/php.ini
Scan this dir for additional .ini files    /etc/php/apache2-php5/ext-active
PHP API    20031224
PHP Extension    20041030
Zend Extension    220040412
Debug Build    no
Thread Safety    disabled
Zend Memory Manager    enabled
IPv6 Support    enabled
Registered PHP Streams    php, file, http, ftp, compress.bzip2, compress.zlib, https, ftps
Registered Stream Socket Transports    tcp, udp, unix, udg, ssl, sslv3, sslv2, tls


As you can see, the configure options contain neither the proper "--with-mime-magic" option nor the outdated "--enable-mime-magic" function. This leads me to believe that I have configured something incorrectly. Has anyone else run across this problem? Thanks in advance for any advice.


Last edited by Leprechaun on Thu Feb 02, 2006 1:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
ecatmur
Advocate
Advocate


Joined: 20 Oct 2003
Posts: 3595
Location: Edinburgh

PostPosted: Thu Feb 02, 2006 4:45 am    Post subject: Reply with quote

It just means the ebuild doesn't handle that configure option.

You could file a request on bugs.gentoo.org, and in the meantime set EXTRA_ECONF="--with-mime-magic" in your environment or in /etc/portage/bashrc. However I doubt Gentoo will add support for it; as the man page says mime_magic is deprecated.
_________________
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Back to top
View user's profile Send private message
CHTEKK
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 458

PostPosted: Thu Feb 02, 2006 8:24 am    Post subject: Reply with quote

Mime_magic is deprecated, exactly, so we dropped it from the supported extensions, please emerge the dev-php5/pecl-fileinfo extension wich is still maintained and supported and does substitute the Mime_magic one.
_________________
Best regards, chtekk.

"We are crazy, but who cares, to our heaven there are stairs!" - Xandria
Back to top
View user's profile Send private message
Leprechaun
n00b
n00b


Joined: 04 Oct 2003
Posts: 49
Location: Minnesota, USA

PostPosted: Thu Feb 02, 2006 1:30 pm    Post subject: Reply with quote

Thanks, that did it. I knew I was missing something. :-)
Back to top
View user's profile Send private message
BlackB1rd
Tux's lil' helper
Tux's lil' helper


Joined: 13 Aug 2003
Posts: 131
Location: /Europe/Netherlands/Haarlem

PostPosted: Thu Mar 30, 2006 4:14 pm    Post subject: php-5.1 Reply with quote

CHTEKK wrote:
Mime_magic is deprecated, exactly, so we dropped it from the supported extensions, please emerge the dev-php5/pecl-fileinfo extension wich is still maintained and supported and does substitute the Mime_magic one.

Emerged it, but it won't help. Still get the undefined function error. Installed php with the following flags:
Code:

[ebuild   R   ] dev-lang/php-5.1.2  -adabas -apache +apache2 -bcmath -berkdb -birdstep +bzip2 -calendar -cdb -cgi -cjk +cli +crypt -ctype +curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob +exif -fastbuild -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp +gd -gd-external +gdbm -gmp -hardenedphp -hash -hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc -ipv6 -java-external -kerberos -ldap -libedit -mcve -memlimit -mhash -ming -msql -mssql +mysql +mysqli +ncurses +nls -oci8 -oci8-instant-client -odbc -pcntl +pcre -pdo -pdo-external -pic -posix -postgres -qdbm +readline -recode -reflection -sapdb -sasl +session +sharedext -sharedmem -simplexml -snmp -soap -sockets -solid +spell -spl -sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -truetype -vm-goto -vm-switch -wddx +xml -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip +zlib


Do I need some other flag to enable?
Back to top
View user's profile Send private message
ikrabbe
n00b
n00b


Joined: 11 Aug 2002
Posts: 26
Location: Dortmund, Germany

PostPosted: Fri Jun 23, 2006 12:12 pm    Post subject: Reply with quote

No you don't need it in your useflags. fileinfo is an external extension to php, so you don't need to recompile php. But what I miss is a valid mime.magic file, that is still needed. The current configuration doens't detects a valid and simple xml file ! So I assume the used mime.magic (if any) is not quite usefull.
Back to top
View user's profile Send private message
ikrabbe
n00b
n00b


Joined: 11 Aug 2002
Posts: 26
Location: Dortmund, Germany

PostPosted: Fri Jun 23, 2006 12:22 pm    Post subject: Reply with quote

Acutally I reviewed the file usage and found out that fileinfo correctly uses /usr/share/misc/file/mime.magic.mgc, which correctly detects "XML document text" but returns "" as mime type string. Something seems to be broken in mime.magic.mgc.

Any hints how this can be fixed ?
Back to top
View user's profile Send private message
kendowns
n00b
n00b


Joined: 02 Dec 2002
Posts: 17

PostPosted: Mon Jan 08, 2007 7:08 pm    Post subject: Deprecated means will disappear, not *did* Reply with quote

Removing this feature from the ebuild breaks the definition of deprecated. Deprecated means a function is supported but discouraged from use because it will disappear in the future, but has not disappeared yet. Removing support for a deprecated function before upstream support is removed breaks applications.
_________________
Every application wants to be a database application when it grows up
Back to top
View user's profile Send private message
wpetya
n00b
n00b


Joined: 16 Aug 2006
Posts: 9

PostPosted: Fri Jan 26, 2007 12:07 pm    Post subject: Re: Deprecated means will disappear, not *did* Reply with quote

kendowns wrote:
Removing this feature from the ebuild breaks the definition of deprecated.


I agree. Perhaps a use flag deprecated (for all deprecated) or deprecated_ prefix for use flags of deprecated features.
Back to top
View user's profile Send private message
SunHateR
n00b
n00b


Joined: 13 Aug 2004
Posts: 74

PostPosted: Sun Jan 28, 2007 11:43 am    Post subject: Reply with quote

ikrabbe wrote:
Acutally I reviewed the file usage and found out that fileinfo correctly uses /usr/share/misc/file/mime.magic.mgc, which correctly detects "XML document text" but returns "" as mime type string. Something seems to be broken in mime.magic.mgc.

Any hints how this can be fixed ?
The same problem. Any help please!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum