简体   繁体   English

消息:模块“ imagick”已加载

[英]Message: Module 'imagick' already loaded

I'm trying implement a custom php query in codeigniter. 我正在尝试在codeigniter中实现自定义php查询。 but I'm getting this error "imagick". 但我收到此错误“ imagick”。 Here is custom php code that is working perfect 这是完美运行的自定义php代码

$query = sprintf("SELECT id , address, name, lat, lng , planted ,
( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * 
  cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * 
  sin( radians( lat ) ) ) ) AS distance FROM plant 
  HAVING distance < '%s' AND planted is %s ORDER BY distance 
  LIMIT 0 , 10", 
  mysqli_real_escape_string($connection, $center_lat), 
  mysqli_real_escape_string($connection, $center_lng), 
  mysqli_real_escape_string($connection, $center_lat), 
  mysqli_real_escape_string($connection, $radius), 
  mysqli_real_escape_string($connection, $planted)); 

 $result = mysqli_query($connection,$query);

Here is the codeigniter code that I have written 这是我写的代码点火器代码

  $query = "SELECT id, name, lat, lon, 
    (3959 * acos( cos( radians($lat) ) * cos( radians( lat ) ) * 
    cos( radians( lon ) - radians($lon) ) + sin( radians($lat) ) * 
    sin( radians( lat ) ) ) ) AS radius FROM users 
    HAVING radius < $radius ORDER BY radius";

    $query = $this->db->query($query);

This error is only occurring for this query only. 仅此查询仅发生此错误。 Please help. 请帮忙。

Screenshot: Error Screen 屏幕截图: 错误屏幕

Check your php.ini file, maybe there are two extension=imagick.so lines. 检查您的php.ini文件,也许有两条extension=imagick.so行。 If yes then you should comment one of this 如果是,那么您应该评论其中一项

imagick is an image processing and creation package that is part of PHP. imagick是一个图像处理和创建包,它是PHP的一部分。

By default, it is not used by CodeIgniter although it can be used by the Image Manipulation Class if the developer explicitly chooses it. 默认情况下,CodeIgniter不会使用它,但是如果开发人员明确选择它,则图像操纵类可以使用它。

Imagick is a dynamic extension to PHP. Imagick是PHP的动态扩展。 Normally, it would be loaded in php.ini but PHP allows modules to be loaded at runtime using the function dl() . 通常,它将在php.ini中加载,但是PHP允许使用dl()函数在运行时加载模块。 CodeIgniter does not ever use dl() to load imagick . CodeIgniter从未使用dl()加载imagick

I'm not seeing any obvious use of image manipulation in the query. 我没有在查询中看到任何明显的图像处理用途。 The error message says nothing about the database. 该错误消息对数据库没有任何说明。

Based on those facts, code that runs either before or after the query is producing the error. 基于这些事实,在查询之前或之后运行的代码会产生错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM