php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26844 Problems with ext/mime_magic
Submitted: 2004-01-08 09:00 UTC Modified: 2004-01-15 01:04 UTC
From: php at humbapa dot ch Assigned: hholzgra
Status: Closed Package: *General Issues
PHP Version: 5CVS OS: Linux
Private report: No CVE-ID:
 [2004-01-08 09:00 UTC] php at humbapa dot ch
Description:
------------
When I start apache2 with php5cvs as SAPI module the error_log contains:

PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:22) '' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:59) 'audio/x-aiff   ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:270) 'text/plain    8bit' is not a valid mimetype, etry skipped in Unknown on line 0

I use the latest PHP5 from CVS and build with:
--with-mime-magic=/usr/local/apache2/conf/magic (the magicfile that comes with apache2)

- is it not possible to use the magicfile from apache2?
- why do the startuperros show up when I set display_startup_errors = Off in php.ini?
- Apache2 exit with segmentation fault when I call the function phpinfo()
- etry should be entry :-)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-09 03:25 UTC] php at humbapa dot ch
With the latest PHP4.3.* from CVS --with-mime-magic=/usr/local/apache2/conf/magic works without any problems
 [2004-01-13 14:34 UTC] sniper@php.net
So PHP 4 CVS works, but PHP 5 doesn't?

 [2004-01-13 14:38 UTC] sniper@php.net
There's new php.ini option, mime_magic.debug, try enable that in your php.ini. (add line 'mime_magic.debug = 1' in it)


 [2004-01-14 04:00 UTC] php at humbapa dot ch
PHP5.0.0RC1-dev
php.ini:
display_startup_errors = Off
mime_magic.debug = 1

the startuperrors are still shown at startup

phpinfo() shows (this time without seg fault):
mime_magic support => invalid magic file, disabled
Directive => Local Value => Master Value
mime_magic.debug => 1 => 1
mime_magic.magicfile => /usr/local/apache2/conf/magic => /usr/local/apache2/conf/magic

there is no problem with PHP4
I think there is something wrong with the magic-file parser in PHP5 (the same file works with PHP4)
 [2004-01-14 10:45 UTC] sniper@php.net
Exactly what errors do you get? (and DO enable the display_startup_errors!!)

 [2004-01-14 11:03 UTC] php at humbapa dot ch
build with:
./configure --prefix=/usr/local/apache2 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --with-mime-magic=/usr/local/apache2/conf/magic

test with (display_startup_errors = On):
./sapi/cli/php -c /usr/local/apache2/conf/php5.ini -r 'phpinfo();'

result:
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:22) '' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:32) '' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:46) '' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:59) 'audio/x-aiff   ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:61) 'audio/x-aiff   ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:63) 'audio/x-aiff   ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:67) 'audio/unknown  ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:71) 'audio/unknown  ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:73) 'audio/unknown  ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:75) 'audio/unknown  ' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:96) 'audio/prs.sid' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:104) 'image/x-xbm   7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:123) 'application/octet-stream      x-compress' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:126) 'application/octet-stream      x-gzip' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:210) 'image/x-portable-bitmap       7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:212) 'image/x-portable-greymap      7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:214) 'image/x-portable-pixmap       7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:270) 'text/plain    8bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:280) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:281) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:282) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:283) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:284) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:285) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:286) 'message/news  8bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:287) 'message/news  8bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:288) 'message/rfc822        7bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:289) 'message/news  8bit' is not a valid mimetype, etry skipped in Unknown on line 0
PHP Warning:  PHP Startup: : (/usr/local/apache2/conf/magic:380) 'video/quicktime ' is not a valid mimetype, etry skipped in Unknown on line 0

full output:
http://www.humbapa.ch/_scripts/phpbug.26844.txt

the magic file I use (from apache 2.0.48):
http://www.humbapa.ch/_scripts/magic
 [2004-01-14 12:57 UTC] sniper@php.net
Assigned to the author. :)

 [2004-01-15 01:04 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 06:02:13 2014 UTC