enable exif for php?

lnguyen

Verified User
Joined
Apr 8, 2004
Messages
85
is there a relatively simple way to add exif support for php? as far as I can tell, i need to recompile php to support it.. but i'm rather new at that..

and if i did, is there anything i would need to watch out for in terms of keeping php working properly w/ DA?

Thanks
Linh
 
Hello,

Download and compile/install exif as per their instructions.

Once that's done, to add it to php, run the following:

cd /usr/local/directadmin/customapache
#edit the configure.php file and add:
--enable-exif
# to the list of configure commands (make sure there is a \ at the end of each line except the last one)
./build clean
./buid php

John
 
Hello,

Download and compile/install exif as per their instructions.

Once that's done, to add it to php, run the following:

cd /usr/local/directadmin/customapache
#edit the configure.php file and add:
--enable-exif
# to the list of configure commands (make sure there is a \ at the end of each line except the last one)
./build clean
./build php

John
I just tried this script and there was one little problem.
At the end the script replaced the httpd.conf file with another one.
My site was not working anymore and the browser asked where to save .php files.
After restoring the old httpd.conf file it worked again.

A bug in the script?
 
I have apache 2, should it be "./build php_ap2 n" on the last line (instead of "./build php")??
 
i just needed to added --enable-with-exif to my configure line an configure php again. That did it. :)
________
CL70
 
Last edited:
Hello,

I have rebuild PHP with --enable-exif and also tried --enable-with-exif
But phpinfo.php does not show the exif extension.

Must I enabled this also in de php.ini file?

Note, I used apache 2.2.15 and PHP 5.2.6 in CGI mode (suphp)

Can anybody help me with these?
 
Custombuild, apache 2.2.15, PHP5 in CGI mode, PHP4 in CLI mode.

I did edit the file: /usr/local/directadmin/custombuild/configure/ap2/configure.php5 and add the following line:
--enable-exif

Then save the file and rebuild php:
./buid php all
service httpd restart

No errors, but also no exif in phpinfo.phh file..

(why start a new topic if here is a old topic with the same problem?)
 
no problem on add to an old 3d, my question was related just cause, has you correctly mentioned, the configuration file is in different position so i needed to point you into the right position...

For what you sayd, everything is correct, i would like suggest you to use ./build php n

The next question is, have you added

--enable-exif

into the last line? have you added a / at the end of the line before the last?
 
Yes, I've added a / to the end before the last line.

but also no exif in phpinfo.php file

=S
 
just to be clear, i wrote the wrong one, a \ is needed and NOT /

Please past your configure.php5

should be like this

Code:
        --enable-zip \
        --enable-wddx \
        --enable-exif

Or, if you want, i should check your box.

Im also thinkin about you using php as cgi maybe with suphp (right?)

If is correct you have to edit this file:

Code:
/usr/local/directadmin/custombuild/configure/suphp/configure.php5

and NOT

Code:
/usr/local/directadmin/custombuild/configure/ap2/configure.php5


Regards
 
Sorry for my spelling mistake, I used a /. And had configured the file:
/ usr/local/directadmin/custombuild/configure/ap2/configure.php5

But leave it as it was and edit the correct file "/ usr/local/directadmin/custombuild/configure/suphp/configure.php5"

This is the content of the file:

Code:
#!/bin/sh
"./configure" \
"--prefix=/usr/local/php5" \
"--enable-force-cgi-redirect" \
"--enable-fastcgi" \
"--with-config-file-path=/usr/local/etc/php5/cgi" \
"--with-curl=/usr/local/lib" \
"--with-gd" \
"--with-gettext" \
"--with-jpeg-dir=/usr/local/lib" \
"--with-freetype-dir=/usr/local/lib" \
"--with-kerberos" \
"--with-openssl" \
"--with-mcrypt" \
"--with-mhash" \
"--with-mysql=/usr" \
"--with-mysqli=/usr/bin/mysql_config" \
"--with-pcre-regex=/usr/local" \
"--with-pdo-mysql=/usr" \
"--with-pear" \
"--with-png-dir=/usr/local/lib" \
"--with-zlib" \
"--with-zlib-dir=/usr/local/lib" \
"--enable-zip" \
"--enable-gd-native-ttf" \
"--with-iconv=/usr/local" \
"--enable-bcmath" \
"--enable-calendar" \
"--enable-ftp" \
"--enable-magic-quotes" \
"--enable-sockets" \
"--enable-mbstring" \
"--enable-exif"

I still can not see the EXIF in the phpinfo, I am trying to install "CF Image Host 1.4" but I get only 1 error:

error: Exif extension is not installed.(the script can be used without exif extension installed) http://php.net/manual/en/book.exif.php

In previous responses mentioned run ". / php buid all", I also I run?, because it does not work, I get error only command or file.
 
Sorry for the double post, but I can not change the content.
I want to show the Begin of the content of my phpinfo.

PHP Version 5.2.14

System
Linux residentidle.net 2.6.18-194.26.1.el5.028stab079.2 #1 SMP Fri Dec 17 19:25:15 MSK 2010 x86_64

Build Date
Oct 27 2010 07:20:18

Configure Command
'./configure' '--prefix=/usr/local/php5' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-path=/usr/local/etc/php5/cgi' '--with-curl=/usr/local/lib' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pcre-regex=/usr/local' '--with-pdo-mysql=/usr' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--enable-gd-native-ttf' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring'

Server API
CGI/FastCGI

Virtual Directory Support
disabled

Configuration File (php.ini) Path
/usr/local/etc/php5/cgi

Loaded Configuration File
/usr/local/etc/php5/cgi/php.ini

Scan this dir for additional .ini files
(none)
additional .ini files parsed
(none)

PHP API
20041225

PHP Extension
20060613

Zend Extension
220060519

Debug Build
no

Thread Safety
disabled

Zend Memory Manager
enabled

IPv6 Support
enabled

Registered PHP Streams
https, ftps, compress.zlib, php, file, data, http, ftp, zip

Registered Stream Socket Transports
tcp, udp, unix, udg, ssl, sslv3, sslv2, tls

Registered Stream Filters
zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed
 
you have to move the configure files to a custom folder

mkdir -p /usr/local/directadmin/custombuild/custom/configure/ap2
cp -rfp /usr/local/directadmin/custombuild/configure/ap2/configure.php5 /usr/local/directadmin/custombuild/custom/configure/ap2/configure.php5
 
uhm, I used:

1. . / build clean
2. . / build php n

from usr / local / DirectAdmin / custombuild / configure, and it worked, thanks for the help.
 
hello
I added entry to configure php
- enable-exif but is a compilation error

/ usr/local/directadmin/custombuild/configure/suphp/configure.php5: line 33: - enable-exif: command not found
please help

my file looks like

"- with-pdo-mysql = / usr" \
"- with-pear '\
"- with-png-dir = / usr / local / lib" \
"- with-zlib '\
"- with-zlib-dir = / usr / local / lib" \
"- enable-zip '\
"- enable-gd-native-ttf '\
"- with-iconv = / usr / local" \
"- enable-bcmath '\
"- enable-calendar '\
"- enable-ftp '\
"- enable-magic-quotes' \
"- enable-sockets' \
"- enable-mbstring '
"- enable-exif '

This file is part configure.php5
 
Back
Top