PHP Warning: Division by zero
Permalink
never seen this before !
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 44
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 51
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 51
I get this when i moved the site to a windows server, here is the environment ...
# concrete5 Version
5.4.1
# concrete5 Packages
None
# concrete5 Overrides
blocks/form, blocks/gallery, blocks/search, blocks/sisimizis_download_folder, single_pages/dashboard, themes/Rob-Roy-theme
# Server Software
Microsoft-IIS/6.0
# Server API
cgi-fcgi
# PHP Version
5.2.9-2
# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date, dom, filter, ftp, gd, gettext, hash, iconv, imap, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, odbc, pcre, PDO, pdo_mysql, Reflection, session, SimpleXML, SPL, standard, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, Zend Optimizer, zip, zlib.
# PHP Settings
log_errors_max_len - 1024
max_execution_time - 5
max_input_nesting_level - 64
max_input_time - 120
memory_limit - 128M
post_max_size - 30M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 20M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH
any windowz people out there with any advice ?
thanks
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 44
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 51
PHP Warning: Division by zero in D:\Domains\mysite.co.uk\wwwroot\concrete\helpers\image.php on line 51
I get this when i moved the site to a windows server, here is the environment ...
# concrete5 Version
5.4.1
# concrete5 Packages
None
# concrete5 Overrides
blocks/form, blocks/gallery, blocks/search, blocks/sisimizis_download_folder, single_pages/dashboard, themes/Rob-Roy-theme
# Server Software
Microsoft-IIS/6.0
# Server API
cgi-fcgi
# PHP Version
5.2.9-2
# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, com_dotnet, ctype, curl, date, dom, filter, ftp, gd, gettext, hash, iconv, imap, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, odbc, pcre, PDO, pdo_mysql, Reflection, session, SimpleXML, SPL, standard, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, Zend Optimizer, zip, zlib.
# PHP Settings
log_errors_max_len - 1024
max_execution_time - 5
max_input_nesting_level - 64
max_input_time - 120
memory_limit - 128M
post_max_size - 30M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 20M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH
any windowz people out there with any advice ?
thanks
I have the same issue. I'm looking to know how repair that.
mmm - guessing...
If it's in the image helper, it's probably trying a getThumbnail, which means it's trying to resize an image. If it can't read the image size correctly using getImageSize(), then it will return zero. When it then tries to perform a calculation to figure out how to resize the image - blurgh. (that's tech speak for "division by zero").
Check your images exist and can be accessed by the webserver.
Also, try creating a really simple page that performs the getImageSize function on an image and see if that works or dies. You appear to have gd library installed, that shouldn't be an issue...
Jon
If it's in the image helper, it's probably trying a getThumbnail, which means it's trying to resize an image. If it can't read the image size correctly using getImageSize(), then it will return zero. When it then tries to perform a calculation to figure out how to resize the image - blurgh. (that's tech speak for "division by zero").
Check your images exist and can be accessed by the webserver.
Also, try creating a really simple page that performs the getImageSize function on an image and see if that works or dies. You appear to have gd library installed, that shouldn't be an issue...
Jon
I found !
It happend when the image heleper try to getThumbnail from a mp3, flash or mov.
I think there are some changement since 5.4.1..
It happend when the image heleper try to getThumbnail from a mp3, flash or mov.
I think there are some changement since 5.4.1..
how did you repair this error message so the thumbnails show?
in concrete/helpers/image.php
line 29
add .... error_reporting(0);
not the best way i guess but it suppresses the warning.
This seems to only affect windows, i might be clutching at straws here but i think it is the way IIS handles decimal places.
line 29
add .... error_reporting(0);
not the best way i guess but it suppresses the warning.
This seems to only affect windows, i might be clutching at straws here but i think it is the way IIS handles decimal places.