0

我正在使用 codeigniter 验证码助手。我已按照手册进行操作,并且在本地服务器上运行良好。但是当我将它移到托管服务器时,它不再工作了。我跟踪了问题,发现我的验证码目录路径“./captcha/”未被识别为目录。那有什么问题?就像在我的本地服务器上一样,“./”应该指向我的根目录。我错了吗?

这是我的验证码功能:

protected function captcha($font_size,$width,$height,$exp)
    {
        $vals = array(
            'img_path'   => './captcha/',
            'img_url'    => base_url().'/captcha/',
            'font_path'  => './fonts/AntykwaBold.ttf',
            'font_size'  => $font_size,
            'img_width' => $width,
            'img_height' => $height,
            'expiration' => $exp
        );

        if ($cap = create_captcha($vals)){
            $data = array(
                'captcha_time'  => $cap['time'],
                'ip_address'    => $this->input->ip_address(),
                'word'              => ($cap['word'])
            );
            $query = $this->db->insert_string('captcha', $data);
            $this->db->query($query);
            return $cap;
        } else {
            return false;
        }
    }
4

1 回答 1

0

通常, ./ 是不必要的,至少在标准目录格式中是这样。“/captcha”应该指向您的验证码目录。试试看它是否有效。祝你好运。

于 2013-04-10T01:43:51.450 回答