Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
81/5000显示由PHP创建的浏览器图像';使用Codeigniter的s GD库_Php_Codeigniter_Gd - Fatal编程技术网

81/5000显示由PHP创建的浏览器图像';使用Codeigniter的s GD库

81/5000显示由PHP创建的浏览器图像';使用Codeigniter的s GD库,php,codeigniter,gd,Php,Codeigniter,Gd,我有以下代码在浏览器中显示通过GD库创建的图像,我使用的是CodeIgniter。但是,当我在生产服务器上运行时,图像不会显示。 但是,在纯PHP中运行的同一脚本在服务器上可以完美地工作。Codeigniter是否阻塞了某些内容,我是否可以使用任何设置 <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Tarefa_gd extends MY_Controller { fun

我有以下代码在浏览器中显示通过GD库创建的图像,我使用的是CodeIgniter。但是,当我在生产服务器上运行时,图像不会显示。 但是,在纯PHP中运行的同一脚本在服务器上可以完美地工作。Codeigniter是否阻塞了某些内容,我是否可以使用任何设置

<?php
defined('BASEPATH') OR exit('No direct script access allowed');


class Tarefa_gd extends MY_Controller 
{
    function __construct()
    {
        $this->_modulo      = MODULO_APP;
        $this->_controller  = strtolower( __CLASS__ );

        $this->_verifica_usuario_logado_app();

        parent::__construct();
    }



     function color()
    {
        $my_img = imagecreate( 200, 80 );
        $background = imagecolorallocate( $my_img, 0, 0, 255 );
        $text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
        $line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
        imagestring( $my_img, 4, 30, 25, "thesitewizard.com", $text_colour );
        imagesetthickness ( $my_img, 5 );
        imageline( $my_img, 30, 45, 165, 45, $line_colour );

        header( "Content-type: image/png" );
        imagepng( $my_img );
        imagecolordeallocate( $line_colour );
        imagecolordeallocate( $text_colour );
        imagecolordeallocate( $background );
        imagedestroy( $my_img );
    }

}
?>


函数颜色()
工作正常。我用定制php进行了尝试,也将其放入了codeigniter控制器中,得到的错误是什么?因此,没有错误返回,只是没有生成图像。我正在发送一个相同脚本的示例,一个在CI中,另一个没有。在同一台服务器上运行。有Codeigniter的示例有错误:没有Codeigniter的示例,纯PHP可以工作我相信CI中有某种东西被阻塞了,但我不知道不幸的是什么。您的两个项目都使用相同的PHP版本吗?如果服务器上安装了单独的php版本,请检查php.ini中是否启用了GD库