Php thumb works on development machine but not on server

Post here if you have any problems using phpThumb

Php thumb works on development machine but not on server

Postby Zeu5 » Thu Dec 23, 2010 12:03 pm

Hi all,

I am cross-posting this in stackoverflow as well. Will update this post if i get an answer from stackoverflow
http://stackoverflow.com/questions/4523602/phpthumb-works-in-development-machine-ubuntu-not-on-server-ubuntu

i use capistrano to deploy to my server. so there is symlink involved.

both development machine and server uses ubuntu.

code is exactly the same on both, but development machine had no problems whereas server has a problem.

Please advise. Thank you very very much. I am desperate to get this to work before Xmas day. I don't want this to hang over my head.

Debug messages on my development machine.

2010-12-23 15:37:31 Error: Array
(
[0] => phpThumb() v1.7.9-200805132119 in file "phpthumb.class.php" on line 216
[1] => setSourceFilename(uploads/products/8cb42ecccafe-2.jpg) set $this->sourceFilename to "uploads/products/8cb42ecccafe-2.jpg" in file "phpthumb.class.php" on line 243
[2] => file_exists(/usr/bin/convert) = 1 in file "phpthumb.class.php" on line 1105
[3] => is_executable(/usr/bin/convert) = 1 in file "phpthumb.class.php" on line 1106
[4] => using ImageMagick path from $this->config_imagemagick_path (/usr/bin/convert) in file "phpthumb.class.php" on line 1108
[5] => ImageMagick version checked with ""/usr/bin/convert" --version" in file "phpthumb.class.php" on line 1152
[6] => ImageMagick did not return recognized version string (Version: ImageMagick 6.5.7-8 2010-12-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP) in file "phpthumb.class.php" on line 1158
[7] => ImageMagick convert --version says "" in file "phpthumb.class.php" on line 1160
[8] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 888
[9] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 899
[10] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 916
[11] => $this->sourceFilename set to "/var/www/wp/app/webroot/uploads/products/8cb42ecccafe-2.jpg" in file "phpthumb.class.php" on line 817
[12] => setCacheDirectory() starting with config_cache_directory = "" in file "phpthumb.class.php" on line 923
[13] => $this->config_cache_directory () is not a directory in file "phpthumb.class.php" on line 959
[14] => SetCacheFilename() failed because $this->config_cache_directory is empty in file "phpthumb.class.php" on line 3076
[15] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2920
[16] => GetImageSize(/var/www/wp/app/webroot/uploads/products/8cb42ecccafe-2.jpg) says image is 426x318 in file "phpthumb.class.php" on line 2930
[17] => SetOrientationDependantWidthHeight() starting with "426"x"318" in file "phpthumb.class.php" on line 2899
[18] => SetOrientationDependantWidthHeight() setting w="32", h="32" in file "phpthumb.class.php" on line 2915
[19] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 3015
[20] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3273
[21] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1252
[22] => phpThumb_tempnam() returning "/var/www/wp/app/webroot/pThumbHd2wYY" in file "phpthumb.class.php" on line 3929
[23] => ImageMagickSwitchAvailable(thumbnail) = 1 in file "phpthumb.class.php" on line 1192
[24] => ImageMagickSwitchAvailable(density) = 1 in file "phpthumb.class.php" on line 1192
[25] => GetImageSize(/var/www/wp/app/webroot/uploads/products/8cb42ecccafe-2.jpg) SUCCEEDED: Array
(
[0] => 426
[1] => 318
[2] => 2
[3] => width="426" height="318"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
in file "phpthumb.class.php" on line 1332
[26] => GetImageSize(/var/www/wp/app/webroot/uploads/products/8cb42ecccafe-2.jpg) returned [w=426;h=318;f=2] in file "phpthumb.class.php" on line 1337
[27] => source dimensions set to 426x318 in file "phpthumb.class.php" on line 1340
[28] => SetOrientationDependantWidthHeight() starting with "426"x"318" in file "phpthumb.class.php" on line 2899
[29] => SetOrientationDependantWidthHeight() setting w="32", h="32" in file "phpthumb.class.php" on line 2915
[30] => Remaining $this->fltr after ImageMagick: (array(0) { } ) in file "phpthumb.class.php" on line 1824
[31] => ImageMagickSwitchAvailable(quality;interlace) = 1 in file "phpthumb.class.php" on line 1189
[32] => ImageMagick called as ("/usr/bin/convert" -density 150 -background "#FFFFFF" -thumbnail 32x32 -quality 75 -interlace line "/var/www/wp/app/webroot/uploads/products/8cb42ecccafe-2.jpg[0]" jpeg:"/var/www/wp/app/webroot/pThumbHd2wYY" 2>&1) in file "phpthumb.class.php" on line 1843
[33] => GetImageSize(/var/www/wp/app/webroot/pThumbHd2wYY) returned [w=32;h=24;f=2] in file "phpthumb.class.php" on line 1864
[34] => ImageMagickThumbnailToGD::ImageCreateFromJPEG() succeeded, $this->gdimg_source is now (32x24) in file "phpthumb.class.php" on line 1870
[35] => ImageMagickThumbnailToGD() returning $this->IMresizedData (815 bytes) in file "phpthumb.class.php" on line 1871
[36] => deleting "/var/www/wp/app/webroot/pThumbHd2wYY" in file "phpthumb.class.php" on line 1876
[37] => ImageMagickThumbnailToGD() succeeded in file "phpthumb.class.php" on line 3278
[38] => Not using EXIF thumbnail data because $this->gdimg_source is already set in file "phpthumb.class.php" on line 3325
[39] => CalculateThumbnailDimensions() [x,y,w,h] initially set to [0,0,32,24] in file "phpthumb.class.php" on line 2785
[40] => CreateGDoutput() returning canvas "32x24" in file "phpthumb.class.php" on line 2894
[41] => ImageResizeFunction($o, $s, 0, 0, 0, 0, 32, 24, 32, 24) in file "phpthumb.class.php" on line 3908
[42] => memory_get_usage() after copy-resize = 13097812 in file "phpthumb.class.php" on line 390
[43] => memory_get_usage() after ImageDestroy = 13097936 in file "phpthumb.class.php" on line 392
[44] => AntiOffsiteLinking() says this is allowed in file "phpthumb.class.php" on line 2087
[45] => skipping AlphaChannelFlatten() because !$this->is_alpha in file "phpthumb.class.php" on line 2143
[46] => GenerateThumbnail() completed successfully in file "phpthumb.class.php" on line 404
)


For server it is
2010-12-23 15:52:50 Error: Array
(
[0] => phpThumb() v1.7.9-200805132119 in file "phpthumb.class.php" on line 216
[1] => setSourceFilename(uploads/products/8cb42ecccafe-1.jpg) set $this->sourceFilename to "uploads/products/8cb42ecccafe-1.jpg" in file "phpthumb.class$
[2] => Leaving $this->config_imagemagick_path as (/usr/bin/convert) because !is_execuatable(realpath($this->config_imagemagick_path)) () in file "phpthu$
[3] => file_exists(/usr/bin/convert) = 0 in file "phpthumb.class.php" on line 1105
[4] => is_executable(/usr/bin/convert) = 0 in file "phpthumb.class.php" on line 1106
[5] => ImageMagick version checked with "/usr/bin/convert --version" in file "phpthumb.class.php" on line 1152
[6] => ImageMagick did not return recognized version string (sh: /usr/bin/convert: not found) in file "phpthumb.class.php" on line 1158
[7] => ImageMagick convert --version says "" in file "phpthumb.class.php" on line 1160
[8] => ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path (/usr/bin/convert), and `which convert` returne$
[9] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 888
[10] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 899
[11] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 916
[12] => $this->sourceFilename set to "/var/www/ombi60.biz/releases/20101223144805/app/webroot/uploads/products/8cb42ecccafe-1.jpg" in file "phpthumb.cla$
[13] => setCacheDirectory() starting with config_cache_directory = "" in file "phpthumb.class.php" on line 923
[14] => $this->config_cache_directory () is not a directory in file "phpthumb.class.php" on line 959
[15] => SetCacheFilename() failed because $this->config_cache_directory is empty in file "phpthumb.class.php" on line 3076
[16] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2920
[17] => GetImageSize(/var/www/ombi60.biz/releases/20101223144805/app/webroot/uploads/products/8cb42ecccafe-1.jpg) says image is 426x318 in file "phpthum$
[18] => SetOrientationDependantWidthHeight() starting with "426"x"318" in file "phpthumb.class.php" on line 2899
[19] => SetOrientationDependantWidthHeight() setting w="32", h="32" in file "phpthumb.class.php" on line 2915
[20] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 3015
[21] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3273
[22] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1252
[23] => ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed in file "phpthumb.class.php" on line 1891
[24] => starting ImageCreateFromFilename(/var/www/ombi60.biz/releases/20101223144805/app/webroot/uploads/products/8cb42ecccafe-1.jpg) in file "phpthumb.$
[25] => ImageCreateFromFilename found ($getimagesizeinfo[2]==2) in file "phpthumb.class.php" on line 3197
[26] => Calling ImageCreateFromJPEG(/var/www/ombi60.biz/releases/20101223144805/app/webroot/uploads/products/8cb42ecccafe-1.jpg) in file "phpthumb.class$
[27] => Not using EXIF thumbnail data because $this->gdimg_source is already set in file "phpthumb.class.php" on line 3325
[28] => CalculateThumbnailDimensions() [x,y,w,h] initially set to [0,0,426,318] in file "phpthumb.class.php" on line 2785
[29] => CreateGDoutput() returning canvas "32x23" in file "phpthumb.class.php" on line 2894
[30] => ImageResizeFunction($o, $s, 0, -0, 0, 0, 32, 23.887323943662, 426, 318) in file "phpthumb.class.php" on line 3908
[31] => memory_get_usage() after copy-resize = 21676640 in file "phpthumb.class.php" on line 390
[32] => memory_get_usage() after ImageDestroy = 21676800 in file "phpthumb.class.php" on line 392
[33] => AntiOffsiteLinking() says this is allowed in file "phpthumb.class.php" on line 2087
[34] => skipping AlphaChannelFlatten() because !$this->is_alpha in file "phpthumb.class.php" on line 2143
[35] => GenerateThumbnail() completed successfully in file "phpthumb.class.php" on line 404
[36] => !$this->config_allow_src_above_docroot therefore setting "/var/www/ombi60.biz/current/app/webroot//uploads/products/thumb/icon/8cb42ecccafe-1.jp$
[37] => RenderToFile() failed because "/" is not writable in file "phpthumb.class.php" on line 531

I am cross-posting this in stackoverflow as well. Will update this post if i get an answer from stackoverflow
)
Zeu5
 
Posts: 2
Joined: Thu Dec 23, 2010 11:57 am

Re: Php thumb works on development machine but not on server

Postby Zeu5 » Fri Dec 24, 2010 3:11 am

the solution is to set phpthumb.class.php line 142

var $config_allow_src_above_docroot = true;

this is probably due to the capistrano using symlink but cannot be sure.
Zeu5
 
Posts: 2
Joined: Thu Dec 23, 2010 11:57 am

Re: Php thumb works on development machine but not on server

Postby schwarzenneger » Fri Dec 24, 2010 5:35 am

Zeu5 wrote:the solution is to set phpthumb.class.php line 142

var $config_allow_src_above_docroot = true;

this is probably due to the capistrano using symlink but cannot be sure.


Zeu5, can you please look at viewtopic.php?f=2&t=254 and see if the workaround you mentioned also applies to that question. If yes, what is the best way to set the two variables $PHPTHUMB_CONFIG['document_root'] and $PHPTHUMB_CONFIG['cache_directory']; and how to reference the images outside document root inside the src parameter. Thanks in advance.
schwarzenneger
 
Posts: 2
Joined: Mon Dec 20, 2010 7:15 am
Location: Pakistan


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron