CentOS: 치명적인 오류: 정의되지 않은 함수 EXIF_imagetype() 호출

CentOS: 치명적인 오류: 정의되지 않은 함수 EXIF_imagetype() 호출

CentOS 7.1에서 다음 오류가 발생합니다.

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

/usr/local/lib/php.ini다음 줄에서 이 기능을 활성화 할 수 있습니다 .

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

하지만 내 시스템에서는 EXIF ​​라이브러리를 찾을 수 없습니다! find / -name exif아무것도 발견되지 않았습니다.

이 작업을 수행하면 yum search다음 패키지를 얻습니다.

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

내 질문은 을 제거하고 을 /로 이름을 바꾸면 이 오류 가 ;제거 됩니까, 아니면 패키지 중 하나를 설치해야 합니까?입니다.php_exif.dllphp_mbstring.dllphp_mbstring.sophp_exif.so

나는 이 소프트웨어에 익숙하지 않다!

답변1

실행하는 경우:

$ 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

php-exif이것이 패키지의 일부임을 알 수 있습니다 php-common. 이미 설치한 경우 종속 항목으로 php설치 php-common됩니다.

따라서 세미콜론을 제거할 수 있어야 합니다.

답변2

이것은 충분히 쉬운 수정입니다. 제안된 내용을 읽고 시도했지만 제 경우에는 작동하지 않았습니다. 내가 하는 건 이것 뿐이야

Yum search exif

결과

*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*

다음

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

그게 다야.

관련 정보