Help - Search - Members - Calendar
Full Version: Need some advise on script error/server
The Planet Forums > General > The Lounge
rgpayne
Edit-

It was globals got it fixed thanks
thedude
I'm definitely not a PHP expert, but...

If I'm correct, line 4 is the $image_info=GetImageSize function.

The error says read error..are permissions set appropriately for the files?
Doe the files exist when it tries to create a thumbnail from that picture?


QUOTE (rgpayne @ May 5 2007, 08:53 PM) *
I have a script ( site ) that does thumbnails and I am getting this error
Sat May 5 20:44:47 2007] [error] PHP Warning: getimagesize() [<a href='function.getimagesize'>function.getimagesize</a>]: Read error! in /home2/user/public_html/thumb.php on line 4
[Sat May 5 20:44:47 2007] [error] PHP Warning: getimagesize() [<a href='function.getimagesize'>function.getimagesize</a>]: Read error! in /home2/user/public_html/thumb.php on line 4
-------------
thumb.php
<?
include("config.php");
function makeThumbnail($o_file, $t_ht = 100) {
$image_info = GetImageSize($o_file) ; // see EXIF for faster way

switch ($image_info['mime']) {
case 'image/gif':
if (imagetypes() & IMG_GIF) { // not the same as IMAGETYPE
$o_im = imageCreateFromGIF($o_file) ;
} else {

--------------------

I have two different servers it works on one but does not on the other
ANY help would be highly appreciated I have been searching and searching since 10am this morning and can not come up with what the issue is
serverdoctor
My guess would be either this file is not a valid image, or permissions issues exist which are preventing this user from opening the file. Are you able to open this image in a browser when calling upon it directly?

If you're feeling brave, you could always launch a strace on httpd, perform the request for the script, and terminate the strace:

strace -vvFf -s 4096 -o strace.httpd $(ps -C httpd h | awk '{ print "-p " $1 }')

Once you complete the request, break out of the strace, fire it's output up in vi, and search for 'open("/absolute/path/to/file'. A glance at this open's return value or the system calls surrounding the open should give you some insight as to why this is occurring. If you don't find anything here, search for 'Read error!', then back track a little bit, and you might be able to find some relevant information there icon_smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.