0

On CentOS 7.1, I am greeted with the following error:

Fatal error: Call to undefined function exif_imagetype() in /some/path/to/a/php.file.php on line XXX

I can enable this in /usr/local/lib/php.ini on the following line:

870  ;extension=php_mbstring.dll
871  ;extension=php_exif.dll   ; Must be after mbstring as it depends on it

But the exif library is no where to be found on my system! find / -name exif does not find anything.

When I do yum search, I get the following packages:

libexif-devel.i686 : Files needed for libexif application development
libexif-devel.x86_64 : Files needed for libexif application development
libexif-doc.x86_64 : The EXIF Library API documentation
exiv2.x86_64 : Exif and Iptc metadata manipulation library
exiv2-libs.i686 : Exif and Iptc metadata manipulation library
exiv2-libs.x86_64 : Exif and Iptc metadata manipulation library
libexif.i686 : Library for extracting extra information from image files
libexif.x86_64 : Library for extracting extra information from image files

My question is, if I remove the ;, rename the php_exif.dll and the php_mbstring.dll, to php_mbstring.so/php_exif.so, will I get rid of this error, or do I need to install one of the packages?

I am not familiar with this software!

  • 1
    Why is this voted for closing as off-topic and better suited to StackExchange when it's a simple package installation question? – garethTheRed Apr 21 '16 at 14:46
  • I believe I was one of the "move to SO" voters. It looks to me like a question of how to configure php to enable a particular php function, not an error while trying to install a package. I thought a php programmer might have had better chances of seeing this than a system administrator, but I could be wrong! – Jeff Schaller Apr 21 '16 at 20:23
  • '/usr/local/lib/php.ini' would never be a configuration file for a packaged php from a reputable repo. I suspect it is non-packaged software. – jsbillings Apr 23 '16 at 16:57
1

If you run:

$ yum provides php-exif
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: repo.bigstepcloud.com
 * epel: ftp.heanet.ie
 * extras: mirror.sov.uk.goscomb.net
 * updates: centos.serverspace.co.uk
php-common-5.4.16-36.el7_1.x86_64 : Common files for PHP
Repo        : base
Matched from:
Provides    : php-exif



php-common-5.4.16-36.el7_1.x86_64 : Common files for PHP
Repo        : @base
Matched from:
Provides    : php-exif

you'll see that php-exif is part of the php-common package. If you've installed php then php-common will be installed as a dependency.

Therefore you should be OK to remove the semicolon.

| improve this answer | |
  • Running yum provides php-exif gives me the following message: No matches found. I did, yum list installed php-common, it then said: Error: No matching Packages to list, meaning php-common is not installed? – blade19899 Apr 21 '16 at 14:55
  • Are you sure you're on CentOS 7.1? I've just tried it on two machines and they both work. What does yum info php php-cli show you? You're correct - the error message is telling you it's not installed. Have you installed PHP by anther means, such as compiling it? – garethTheRed Apr 21 '16 at 15:05
  • Will have to check that out tomorrow... – blade19899 Apr 21 '16 at 15:06
0

This is an easy enough fix, I read and tried what was suggested and it did not work in my case. All I did was simply this

Yum search exif

RESULT

*Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 
 * cpanel-addons-production-feed: 
 * cpanel-plugins: 
 * base: centos4.zswap.net
 * epel: mirror.team-cymru.com
 * extras: centos4.zswap.net
 * updates: centos4.zswap.net

================================================ N/S matched: exif ================================================

libexif-devel.i686 : Files needed for libexif application development
libexif-devel.x86_64 : Files needed for libexif application development
libexif-doc.x86_64 : The EXIF Library API documentation
ea-php54-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php55-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php56-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php70-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php71-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php72-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
ea-php73-php-exif.x86_64 : A module for PHP applications that need to work with image metadata
exiv2.x86_64 : Exif and Iptc metadata manipulation library
exiv2-libs.i686 : Exif and Iptc metadata manipulation library
exiv2-libs.x86_64 : Exif and Iptc metadata manipulation library
jhead.x86_64 : Tool for displaying EXIF data embedded in JPEG images
libexif.i686 : Library for extracting extra information from image files
libexif.x86_64 : Library for extracting extra information from image files
metadata-extractor2.noarch : Extracts EXIF, IPTC, XMP, ICC and other metadata from image files
nodejs-duplexify.noarch : Turn a writeable and readable stream into a single streams2 duplex stream
perl-Image-ExifTool.noarch : Utility for reading and writing image meta info
renrot.noarch : A program to rename and rotate files according to EXIF tags*

Next

yum install ea-php73-php-exif.x86_64 -y

That's that.

| improve this answer | |
  • That isn't an answer. – vonbrand Mar 17 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.