Can't get exif working

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
jrichman
-


Joined: 19 Oct 2006
Posts: 2

PostPosted: Thu Oct 19, 2006 6:27 pm    Post subject: Can't get exif working Reply with quote

I've seen a similar post but that person got different results. Please note ch below ***** is at the top of each segment of information I'm provding here.
(BTW I downloaded the binary versioni of PHP for windows, I did not compile the source myself.)

Yes, I have uncommented mbstring and exif in the php.ini file, yes I have put the directory where the dll's live in my path and copied them into the php directory as well, for good measure (but only after I ran into this problem).

I am running this under Tomcat 5.5.

Thanks for any help you can give me.

Jeremy

***** My error message:
Fatal error: Call to undefined function exif_imagetype() in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\fun\upload.php on line 4

My script:
<?php
$MAXIMUM_FILESIZE = 1024 * 200; // 200KB
$MAXIMUM_FILE_COUNT = 10; // keep maximum 10 files on server
echo exif_imagetype($_FILES['Filedata']);
if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE) {
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./temporary/".$_FILES['Filedata']['name']);
$type = exif_imagetype("./temporary/".$_FILES['Filedata']['name']);
if ($type == 1 || $type == 2 || $type == 3) {
rename("./temporary/".$_FILES['Filedata']['name'], "./images/".$_FILES['Filedata']['name']);
} else {
unlink("./temporary/".$_FILES['Filedata']['name']);
}
}
$directory = opendir('./images/');
$files = array();
while ($file = readdir($directory)) {
array_push($files, array('./images/'.$file, filectime('./images/'.$file)));
}
usort($files, sorter);
if (count($files) > $MAXIMUM_FILE_COUNT) {
$files_to_delete = array_splice($files, 0, count($files) - $MAXIMUM_FILE_COUNT);
for ($i = 0; $i < count($files_to_delete); $i++) {
unlink($files_to_delete[$i][0]);
}
}
print_r($files);
closedir($directory);

function sorter($a, $b) {
if ($a[1] == $b[1]) {
return 0;
} else {
return ($a[1] < $b[1]) ? -1 : 1;
}
}
?>



My phpinfo:
PHP Version 5.1.6

System Windows NT JEREMYRICHMAN 5.1 build 2600
Build Date Aug 23 2006 16:31:18
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Java Servlet
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
PHP API 20041225
PHP Extension 20050922
Zend Extension 220051025
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


******Dll test
When I run this script:
<?php
error_reporting(E_ALL);
var_dump(dl("php_exif.dll"));
var_dump(dl("php_mbstring.dll"));
?>

I get:
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_exif.dll in your php.ini in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\fun\exif.php on line 3
bool(false)
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_mbstring.dll in your php.ini in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\fun\exif.php on line 4
bool(false)
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Oct 20, 2006 1:11 pm    Post subject: Re: Can't get exif working Reply with quote

jrichman,

We suggest that you download our pre-configured PHP 5 package from http://www.aprelium.com/abyssws/php5win.html , install it, and uncomment the php_exif.dll line in its php.ini (this is explained in the end of the download page).

The problem you are having is with your extension paths. Our pre-configured package takes care of that kind of issues automatically.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Mikor
-


Joined: 21 Aug 2006
Posts: 144
Location: Hull, England

PostPosted: Fri Oct 20, 2006 4:54 pm    Post subject: Re: Can't get exif working Reply with quote

jrichman wrote:
***** My error message:
Fatal error: Call to undefined function exif_imagetype() in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\fun\upload.php on line 4


This is a forum for Abyss, not Apache
_________________
Yarrt.com - Free Arcade
RypNet.co.uk - Online Game

MSN:
michael_walker_2004 <at> hotmail <dot> com
Back to top View user's profile Send private message Send e-mail MSN Messenger
jrichman
-


Joined: 19 Oct 2006
Posts: 2

PostPosted: Fri Oct 20, 2006 6:13 pm    Post subject: Re: Can't get exif working Reply with quote

aprelium wrote:
jrichman,

We suggest that you download our pre-configured PHP 5 package from http://www.aprelium.com/abyssws/php5win.html , install it, and uncomment the php_exif.dll line in its php.ini (this is explained in the end of the download page).

The problem you are having is with your extension paths. Our pre-configured package takes care of that kind of issues automatically.


Thank you for that suggestion. Unfortunately it did not solve the problem, I still get the exact same message (and yes I have changed my path and PHPRC environment variables and rebooted). I did have to install the pecl that I downloaded elsewhere, it's the same version as your php5; perhaps Tomcat needs it but Abyss doesn't?).

As someone pointed out, this forum, while it IS about PHP issues, is for Abyss and not Tomcat, so perhaps I shouldn't pursue the matter here -- the only reason I did is that in my google search for the errors message I am getting, I found an earlier post -- which was unanswered -- from someone else who had the same message, and I had hoped someone here could help me out.

Jeremy
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Oct 21, 2006 12:44 pm    Post subject: Re: Can't get exif working Reply with quote

jrichman wrote:
Thank you for that suggestion. Unfortunately it did not solve the problem, I still get the exact same message (and yes I have changed my path and PHPRC environment variables and rebooted).


The point of installing the pre-configured PHP package (with FastCGI or CGI) is to solve your path problems and to use the php.ini that comes with it. If you add the PHPRC variable and use another php.ini you're going to have the same problems again.

Please do a simple installation of pre-configured PHP package and let it use its own php.ini. Edit its php.ini (it is in the preconf PHP 5 installation directory) to uncomment the exif extension.

BTW, the error messages you got are related to the DLL loading problem. The message "Warning: dl() [function.dl]: Not supported in multithreaded Web servers" means that dl() won't work on your PHP setup. The message is a bit misleading: when you use ISAPI or the Apache module version of PHP, support for this function will be disabled. The problem does not come from web servers but from PHP which has problems with sharing extensions in a multithreaded context.

dl() use is not recommended in PHP 5 and will be removed in later releases. It is still supported on the CGI/FastCGI version.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group