我已经完成了图像上传,在CI中重复了很多次.相同的代码在一个页面中工作,但在其他页面中不起作用.当我显示错误时,它显示"您的服务器不支持处理此类图像所需的GD功能." 上传图片的代码是...... \
function do_upload() {
$original_path = './uploads/activity_images/original';
$resized_path = './uploads/activity_images/resized';
$thumbs_path = './uploads/activity_images/thumb';
$this->load->library('image_lib');
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png', //only accept these file types
'max_size' => 2048, //2MB max
'upload_path' => $original_path //upload directory
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$image_data = $this->upload->data(); //upload the image
$image1 = $image_data['file_name'];
//your desired config for the resize() function
$config = array(
'source_image' => $image_data['full_path'], //path to the uploaded image
'new_image' => $resized_path,
'maintain_ratio' => true,
'width' => 128,
'height' => 128 …Run Code Online (Sandbox Code Playgroud) 我正在尝试从控制器执行一些自定义工匠命令,例如
Artisan::call('php artisan MyCustomCommand');
但是当我执行时它工作正常
php artisan MuCustomCommand from CLI.
我在app/start/artisan.php.
Even 中注册的命令Artisan::call('php artisan --help');不起作用。