Your server does not support the GD function required to process this type of image.Ci

前端 未结 4 716
有刺的猬
有刺的猬 2020-12-11 04:06

I had done image upload,resized many times in CI. The same code is working in one page but not working in other page . when i display the error it says\" Your server does no

相关标签:
4条回答
  • 2020-12-11 04:11

    I had all of the above set still I was shown

    "Your server does not support the GD function required to process this type of image."

    I went through some research to re-installed or fixed the installation of the php-gd library. You can do this by issuing the following command:

    sudo apt-get install php7.1-gd
    

    and once done, I have restarted apache2

    sudo service apache2 restart
    

    It worked perfectly.

    You can change php7.1-gd based on your PHP version installed on your machine.

    0 讨论(0)
  • 2020-12-11 04:22

    During my project I faced similar problem. This link help me to solve it.

    Replace

    $this->load->library('image_lib', $config);
    

    with

    $this->load->library('image_lib');
    // Set your config up
    $this->image_lib->initialize($config);
    // Do your manipulation
    $this->image_lib->clear();
    
    0 讨论(0)
  • 2020-12-11 04:35

    change your first lines from:

    $original_path = './uploads/activity_images/original';
    $resized_path = './uploads/activity_images/resized';
    $thumbs_path = './uploads/activity_images/thumb';
    $this->load->library('image_lib');
    

    to:

    $config['image_library'] = 'gd2';
    $original_path = './uploads/activity_images/original';
    $resized_path = './uploads/activity_images/resized';
    $thumbs_path = './uploads/activity_images/thumb';
    $this->load->library('image_lib', $config);
    
    0 讨论(0)
  • 2020-12-11 04:36

    If nothing works (my case), the error might actually be the whole issue.

    1. Check if you have gd installed, on linux you would do

      sudo yum list installed | grep php

    2. If not installed, install it

      sudo yum install php-gd-package-name

    3. RESTART your apache

      sudo service httpd restart

    0 讨论(0)
提交回复
热议问题