Gd2 也已启用。试了很多方法。。。不知道怎么回事
遇到 PHP 错误 严重性:通知消息:getimagesize():读取错误!文件名:libraries/Image_lib.php 行号:1651
回溯:文件:/opt/lampp/htdocs/ciflix/application/controllers/Admin.php 行:52 功能:库文件:/opt/lampp/htdocs/ciflix/index.php 行:315
函数:require_once
提供的图像无效。
您的服务器不支持处理此类图像所需的 GD 功能。
$config['upload_path'] = $path;
$config['allowed_types'] = $allowed_types;
$config['max_size'] = 15000;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')){
$this->session->set_flashdata('file_error', $this->upload->display_errors());
redirect('admin/create_blog');
}else{
$data = $this->upload->data('userfile');
$config['image_library'] = 'gd2';
$config['source_image'] = $path.$data['userfile'];
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = FALSE;
$config['width'] = 200;
$config['height'] = 200;
$config['new_image'] = $path.$data['userfile'];
$this->load->library('image_lib', $config);
if(!$this->image_lib->resize()){
echo $this->image_lib->display_errors();
exit();
} else {
echo "Working";
exit();
}
$post_image = $_FILES['userfile']['name'];
}