【发布时间】:2017-06-15 13:37:49
【问题描述】:
这段代码:
{
$this->load->helper('form');
$this->load->helper('captcha');
// Captcha configuration
$config = array(
'img_path' => 'captcha/',
'img_url' => base_url().'captcha/',
'img_width' => '150',
'img_height' => 50,
'word_length' => 3,
'font_size' => 35,
'pool' => '0123456789',
);
$captcha = create_captcha($config);
// Unset previous captcha and store new captcha word
$this->session->unset_userdata('captchaCode');
$this->session->set_userdata('captchaCode',$captcha['word']);
// Send captcha image to view
$data['captchaImg'] = $captcha['image'];
$this->load->view('Login', $data);
}
在 Windows 中很好地生成验证码,图像在验证码文件夹中创建并显示在视图中。 问题是我将我的 Codeiniter 网站移动到 linux CentOs7,我将 www 文件夹权限更改为 777,所有者是 apache,但在验证码文件夹中仍然没有创建图像,当然也没有验证码图像出现在视图中。
ls -ld www ===> drwxrwxrwx. 4 apache apache 33 Jun 11 17:18 www
ls -ld www/html/CodeIgniter-3.1.3/captcha/ =======>
drwxrwxrwx. 2 apache apache 6 Jun 15 06:06 www/html/CodeIgniter-3.1.3/captcha/
【问题讨论】:
标签: captcha codeigniter-3 centos7 chmod chown