Call to undefined function ctype_digit

BASE-user
dkim777
2008-09-29
2013-06-03
  • dkim777
    dkim777
    2008-09-29

    I'm getting following error when I try to run the Graph.

    Fatal error:  Call to undefined function ctype_digit() in

    any ideas?

     
    • Hello,

      according to my manual ctype_digit() is part of php since version 4.0.4.

      Do you run an older version of php? If so, I would recommend an upgrade...

      Bye, bye,

      Juergen

       
    • dkim777
      dkim777
      2008-09-29

      as far as I know, I'm running PHP5.

      using SuSe 10.1
      somehow it doens't have pear but has php5-pear
      I hope that is enough.

       
      • Hello,

        strange.  Well, as a poor workaround you can simply delete the line

        (ctype_digit($element_start)) &&

        in base_graph_main.php.

        Or, slightly better, replace it by

        (is_digit($element_start)) &&

        As to the versions:

        php -r "phpinfo();" | less

        grep -i php /var/log/httpd/error_log

        bye, bye

        Juergen

         
    • dkim777
      dkim777
      2008-10-01

      Juergen

      if I delete line (ctype_digit($element_start)) &&     then I get following error.

      /srv/www/htdocs/base-php4/base_graph_display.php:356: WARNING: Verdana could not be resolved into a readable font file. Check "Image/Canvas/Fonts/fontmap.txt" in your PEAR directory. This directory can be found by pear 'config-show | grep "PEAR directory"'. Falling back to default font without the possibility to adjust any font sizes

      the file fontmap.txt is in the directory but what do it do with it?

      if I replace it with "is_digit" then I get same error as before like below.

      PHP Fatal error:  Call to undefined function is_digit() in /srv/www/htdocs/base-php4/base_graph_main.php on line 430,

      any more ideas?
      Thanks

       
    • oh sorry, that was my fault. is_digit() does indeed not exist.
      The   line should have been as follows:

      (is_numeric($element_start)) &&

      Cf. http://www.php.net/manual/en/function.is-numeric.php

      http://www.php.net/manual/en/function.ctype-digit.php

      As far as the fontmap.txt message is concerned, this is not an error,
      but a warning. This file maps font names to font files. And these
      font files should be valid filenames. They should be present anywhere on your system.  If this is too difficult you can safely ignore the font problem.

      Bye, bye

      Juergen

       
    • GuinnessStout
      GuinnessStout
      2009-01-06

      I am having the same issue.  I attempted the (is_numeric($element_start)) && replace but get the following error

      /var/log/apache2/error_log

      [Mon Jan 05 19:49:49 2009] [error] [client 127.0.0.1] /var/www/localhost/htdocs/base/base_graph_display.php:356: WARNING: Verdana could not be resolved into a readable font file. Check "Image/Canvas/Fonts/fontmap.txt" in your PEAR directory. This directory can be found by pear 'config-show | grep "PEAR directory"'. Falling back to default font without the possibility to adjust any font sizes, referer: http://localhost/base/base_graph_main.php

      cat /usr/share/php/Image/Canvas/Fonts/fontmap.txt

      Arial,arial.ttf
      Arial Bold,arialbd.ttf
      Arial Bold Italic,arialbi.ttf
      Arial Italic,ariali.ttf
      Courier New,cour.ttf
      Courier New Bold,courbd.ttf
      Courier New Bold Italic,courbi.ttf
      Courier New Italic,couri.ttf
      Garamond,gara.ttf
      Garamond Bold,garabd.ttf
      Garamond Italic,garait.ttf
      Gothic,gothic.ttf
      Gothic Bold,gothicb.ttf
      Gothic Bold Italic,gothicbi.ttf
      Gothic Italic,gothici.ttf
      Sans Serif,micross.ttf
      Reference Sans Serif,refsan.ttf
      Times New Roman,times.ttf
      Times New Roman Bold,timesbd.ttf
      Times New Roman Bold Italic,timesbi.ttf
      Times New Roman Italic,timesi.ttf
      Verdana,verdana.ttf
      Verdana Bold,verdanab.ttf
      Verdana Bold Italic,verdanaz.ttf
      Verdana Italic,verdanai.ttf

      slocate verdana.tff                                    

      /usr/share/fonts/corefonts/verdanab.ttf

      phpinfo()
      PHP Version => 5.2.8-pl1-gentoo

       
      • Hello GuinnessStout,

        There may have been a typo:

        You wrote verdana.tff rather than verdana.ttf.
        And the bold version verdanab.ttf is not the same as the simple one verdana.ttf.

        Having said that, simply try and use absolute paths in that fontmap file.

        For example:

        Verdana,/usr/share/fonts/dejavu/DejaVuSans.ttf

        BTW, the bug with the pear command in the error message is fixed in CVS, now.  It should read as:

        pear 'config-show' | grep "PEAR directory"

        Bye, bye

        Juergen