Home  >  Q&A  >  body text

php - Verification code is available under windows, but not in centos?

Font in$this->font = dirname(__FILE__).'/font/elephant.ttf';
Display background:

imagefilledrectangle($this->img,0,$this->height,$this->width,0,$color);

Display code:

imagettftext($this->img,$this->fontsize,mt_rand(-30,30),$_x*$i+mt_rand(1,5),$this->height / 1.4,$this->fontcolor,$this->font,'字');

The verification code can be displayed in windows, as follows:

This is the only way in centos

为情所困为情所困2692 days ago867

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-06-30 09:55:14

    There is no gd extension on centos

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-30 09:55:14

    Turn on error messages to know what went wrong display_errors

    reply
    0
  • Cancelreply