Red Hat Bugzilla – Bug 850923
"file -i" doesn't recognize PHP scripts
Last modified: 2013-03-11 04:33:34 EDT
Description of problem:
"file -i" doesn't seem to have the right "magic" to recognize PHP scripts ("file" without -i does).
The builtin "magic.mime" file distributed with "file" doesn't seem to have anything pertaining to PHP.
/usr/share/file/magic does have some stuff to recognize PHP files.
Is this intentional, or just an oversight? The behavior seems to have changed in more recent Fedora / Redhat releases.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
$ file -i /tmp/ldap.php.pdf
/tmp/ldap.php.pdf: text/plain; charset=us-ascii
/tmp/ldap.php.pdf: text/x-php; charset=us-ascii
My co-worker got the "expected results" above on a FC16 box with file 5.07-6.fc16. I haven't checked RHEL6 yet.
[Obviously, in the example above, the example file "ldap.php.pdf" is a PHP script, not a PDF]
I am sorry, but it is now too late in the RHEL-5 release cycle.
RHEL-5.10 (the next RHEL-5 minor release) is going to be the first
production phase 2  release of RHEL-5. Since phase 2 we'll be
addressing only security and critical issues.
This one issue is fixed in RHEL-6 therefore I am closing the bug as