duanaixuan7385 2012-12-15 06:22
浏览 67

如何修改Php.ini以启用GD jpeg支持?

I'm using PHP 5.2.0 on IIS 6. I wonder what should I do to enable GD Jpeg support, I've already uncommented extension = hp_gd2.dll in php.ini but still not getting the expected result. Am I missing a step?

EDIT ----------> well using this code:

<?php
function LoadJpeg($imgname)
{
    /* Attempt to open */
    $im = @imagecreatefromjpeg($imgname);

    /* See if it failed */
    if(!$im)
    {
        /* Create a black image */
        $im  = imagecreatetruecolor(150, 30);
        $bgc = imagecolorallocate($im, 255, 255, 255);
        $tc  = imagecolorallocate($im, 0, 0, 0);

        imagefilledrectangle($im, 0, 0, 150, 30, $bgc);

        /* Output an error message */
        imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
    }

    return $im;
}

header('Content-Type: image/jpeg');

$img = LoadJpeg('progressive.jpg');

imagejpeg($img);
imagedestroy($img);
?>

I expect to get progressive image load, but I get error instead. - I haven't recompile php after modifying php.ini <------ Should I? if so, how would I recompile php?

  • 写回答

2条回答 默认 最新

  • doudou8893 2012-12-15 06:26
    关注

    Make sure your php.ini file contains a line like "extension_dir="C:\php\ext" replace that file path with the actual location of the dll you are tyring to activate.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料