• 16-09-2013, 18:57:13
    #1
    Merhabalar

    PHP.İni ' ye şu komutu eklemem gerekiyor ancak forumlarda araştırmama rahmen bi sonuç alamadım

    "imagettftext" komutunu php.ini ye nasıl ekleyebilirim ?
  • 16-09-2013, 20:52:12
    #2
    php.ini ye ekleyemezsin bunu zaten php nin bir fonksiyonu, http://php.net/manual/en/function.imagettftext.php

    php kodlarının arasında çalıştıracaksın, örneğin;

    <?php
    // Set the content-type
    header('Content-Type: image/png');
    
    // Create the image
    $im = imagecreatetruecolor(400, 30);
    
    // Create some colors
    $white = imagecolorallocate($im, 255, 255, 255);
    $grey = imagecolorallocate($im, 128, 128, 128);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 399, 29, $white);
    
    // The text to draw
    $text = 'Testing...';
    // Replace path by your own font path
    $font = 'arial.ttf';
    
    // Add some shadow to the text
    imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
    
    // Add the text
    imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
    
    // Using imagepng() results in clearer text compared with imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>
    çıktısı aşağıdaki gibi olacaktır

  • 17-09-2013, 09:39:12
    #3
    victories adlı üyeden alıntı: mesajı görüntüle
    php.ini ye ekleyemezsin bunu zaten php nin bir fonksiyonu, http://php.net/manual/en/function.imagettftext.php

    php kodlarının arasında çalıştıracaksın, örneğin;

    <?php
    // Set the content-type
    header('Content-Type: image/png');
    
    // Create the image
    $im = imagecreatetruecolor(400, 30);
    
    // Create some colors
    $white = imagecolorallocate($im, 255, 255, 255);
    $grey = imagecolorallocate($im, 128, 128, 128);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 399, 29, $white);
    
    // The text to draw
    $text = 'Testing...';
    // Replace path by your own font path
    $font = 'arial.ttf';
    
    // Add some shadow to the text
    imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
    
    // Add the text
    imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
    
    // Using imagepng() results in clearer text compared with imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>
    çıktısı aşağıdaki gibi olacaktır

    O Sorunu giderdim şimdide
    GD2 Kütüphanesini kurdum ancak GD2 Kütüphanesini php.ini ' ye nasıl ekleyebilirim ?
  • 17-09-2013, 23:00:50
    #4
    biletci adlı üyeden alıntı: mesajı görüntüle
    O Sorunu giderdim şimdide
    GD2 Kütüphanesini kurdum ancak GD2 Kütüphanesini php.ini ' ye nasıl ekleyebilirim ?
    paneline bağlı olarak php-gd paketini panel üzerinden kurman gerekebilir. cpanel değilse makinen aşağıdaki komutla kurabilirsin

    yum install php-gd.x86_64 gd.x86_64 gd-devel.x86_64

    veya kullandığın paneli söylersen ona göre kesin cevap verebiliriz.
  • 18-09-2013, 12:55:56
    #5
    victories adlı üyeden alıntı: mesajı görüntüle
    paneline bağlı olarak php-gd paketini panel üzerinden kurman gerekebilir. cpanel değilse makinen aşağıdaki komutla kurabilirsin

    yum install php-gd.x86_64 gd.x86_64 gd-devel.x86_64

    veya kullandığın paneli söylersen ona göre kesin cevap verebiliriz.
    cPanel / whm kullanıyordum.Easy apache kısmından kolay bi şekilde kurulum yapıldı.Yardımın için çok teşekkür ediyorum