PHP-FPM Exif extension not working properly

wattie

Verified User
Joined
May 31, 2008
Messages
1,206
Location
Bulgaria
Today I switched from SuPHP to PHP-FPM. OS is FreeBSD 11. Everything worked fluent except the EXIF extension. Here is my configure.php71 file:

Code:
root@srv2:/usr/local/directadmin/custombuild/configure/fpm # cat configure.php71
#!/bin/sh
./configure \
        --prefix=/usr/local/php71 \
        --program-suffix=71 \
        --with-config-file-scan-dir=/usr/local/php71/lib/php.conf.d \
        --with-curl=/usr/local/lib \
        --with-gd \
        --enable-gd-native-ttf \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl \
        --with-mcrypt \
        --with-mhash \
        --with-mysql-sock=/tmp/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pcre-regex=/usr/local \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --with-zlib-dir=/usr/local/lib \
        --enable-zip \
        --with-iconv=/usr/local \
        --enable-bcmath \
        --enable-calendar \
        --enable-ftp \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --with-icu-dir=/usr/local/icu \
        --with-xmlrpc \
        [B]--enable-exif \[/B]
        --enable-intl

Here is the output of php -m:

Code:
root@srv2:/usr/local/php71/bin # ./php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
[B]exif[/B]
fileinfo
filter
ftp
gd
gettext
hash
htscanner
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Yet I get these in the error logs:

Code:
[Sun Jul 23 01:34:15.480974 2017] [proxy_fcgi:error] [pid 22782:tid 34448335872] [client ***********:59705] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function exif_read_data() in ...

I am unsure what I am missing here...
 
Last edited:
First thing I notice is that your configure.php71 is wrong, because it is missing parts related to fpm. Here is the default /usr/local/directadmin/custombuild/configure/fpm/configure.php71

Code:
#!/bin/sh
./configure \
	--prefix=/usr/local/php71 \
	--program-suffix=71 \
	--enable-fpm \
	--with-config-file-scan-dir=/usr/local/php71/lib/php.conf.d \
	--with-curl=/usr/local/lib \
	--with-gd \
	--enable-gd-native-ttf \
	--with-gettext \
	--with-jpeg-dir=/usr/local/lib \
	--with-freetype-dir=/usr/local/lib \
	--with-libxml-dir=/usr/local/lib \
	--with-kerberos \
	--with-openssl \
	--with-mcrypt \
	--with-mhash \
	--with-mysql-sock=/var/lib/mysql/mysql.sock \
	--with-mysqli=mysqlnd \
	--with-pcre-regex=/usr/local \
	--with-pdo-mysql=mysqlnd \
	--with-pear \
	--with-png-dir=/usr/local/lib \
	--with-xsl \
	--with-zlib \
	--with-zlib-dir=/usr/local/lib \
	--enable-zip \
	--with-iconv=/usr/local \
	--enable-bcmath \
	--enable-calendar \
	--enable-ftp \
	--enable-sockets \
	--enable-soap \
	--enable-mbstring \
	--with-icu-dir=/usr/local/icu \
	--enable-intl
Edit: You are missing the line "--enable-fpm ", have not looked closely, so don't know if there is other lines missing too.
 
Last edited:
That was it. I did the mistake to copy the suphp configuration.php* files by assuming that they are the same (and on first look they look quite the same without that single line).

Problem solved.
 
Back
Top