Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

samirapadidar's avatar

GD Library extension not available with this PHP installation.

Hello, I have created a store site with the admin panel using Laravel, but in the admin panel, when I want to create a new record, I encounter the following error.

‍‍GD Library extension not available with this PHP installation. This is my route

Route::prefix('/admin')->group(function(){
        Route::resource('/brands',BrandController::class);

this is my html page

<form action="{{ route('brands.store') }}" method="post" enctype="multipart/form-data">
    @csrf
    <input type="text" name="brand_name_en" class="form-control" required="" data-validation-required- 
    message="This field is required">
   @error('brand_name_en')
       <span class="alert text-danger">{{ $message }}</span>
   @enderror        
   <input type="text" name="brand_name_fa" class="form-control" required="" data-validation-required- 
    message="This field is required">
    @error('brand_name_fa')
        <span class="alert text-danger">{{ $message }}</span>
    @enderror
<input type="file" name="brand_image" class="form-control" required="" data-validation-required-message="This field is required"> <div class="help-block">
@error('brand_image')
    <span class="alert text-danger">{{ $message }}</span>
@enderror
 <button type="submit" class="btn btn-rounded btn-info">Submit</button>
</form>

this is my controller

public function store(BrandStoreRequest $request)
    {

        if($request->file('brand_image')){
            $upload_location = 'upload/brands/';
            $file = $request->file('brand_image');
            $name_gen = hexdec(uniqid()).'.'.$file->getClientOriginalExtension();
            Image::make($file)->resize(600,600)->save($upload_location.$name_gen);
            $save_url = $upload_location.$name_gen;

            Brand::create([
                'brand_name_en' => $request->input('brand_name_en'),
                'brand_name_fa' => $request->input('brand_name_fa'),
                'brand_slug_en' => Str::slug($request->input('brand_slug_en')),
                'brand_slug_fa' => Str::slug($request->input('brand_slug_fa')),
                'brand_image' => $save_url
            ]);
        }else{
            Brand::create([
                'brand_name_en' => $request->input('brand_name_en'),
                'brand_name_fa' => $request->input('brand_name_fa'),
                'brand_slug_en' => Str::slug($request->input('brand_slug_en')),
                'brand_slug_bn' => Str::slug($request->input('brand_slug_bn')),
            ]);
        }

        $notification = [
            'message' => 'Brand Created Successfully!!!',
            'alert-type' => 'success'
        ];

        return redirect()->route('brands.index')->with($notification);
    }

I tried to change php version from 8 to 7 but my composer didnt work and say me your composer work by php8 version how can I fix this error ??

pleas help me!!!!!

0 likes
1 reply
Sinnbeck's avatar

Install gd library then. How did you install php?

Please or to participate in this conversation.