Home > OS >  Why is the metod not working Codeigniter 4
Why is the metod not working Codeigniter 4

Time:08-25

I'm having problems trying to manipulate images CodeIgniter 4.

My code:

$x_file = $this->request->getFile('file');
      $image = \Config\Services::image()
          ->withFile($x_file)
          ->resize(100, 100, true, 'height')
          ->save(FCPATH .'/images/'. $x_file->getRandomName());
      $x_file->move(WRITEPATH . 'uploads');
      $fileData = [
          'name' =>  $x_file->getName(),
          'type'  => $x_file->getClientMimeType()
      ];
      $store = $db->insert($fileData);

Output:

CodeIgniter\Images\Expections\ImageExpection The framework needs the following extension(s) installed and loaded: GD

My server (ubuntu) have php 8.1.9 included GD (php.ini allow)

Please help, what is the problem?

CodePudding user response:

gd extension not loaded - if (! extension_loaded('gd')), check phpinfo()

  • Related