./my/path/无法识别为托管服务器中的目录

时间:2013-04-10 01:27:37

标签: php directory codeigniter-2 captcha

我正在使用codeigniter验证码助手。我已经关注了manual,它在本地服务器上运行良好。但是,当我将它移动到托管服务器时,它不再工作了。我已经跟踪了问题,发现我的验证码目录路径“./ 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;
        }
    }

1 个答案:

答案 0 :(得分:0)

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