imagecreatefromjpeg and similar functions are not working in PHP

前端 未结 11 1013
攒了一身酷
攒了一身酷 2020-12-08 09:06

I’ve searched for this and the solutions provided in past questions are completely incomprehensible to me. Whenever I run functions like imagecreatefromjpeg, I

相关标签:
11条回答
  • 2020-12-08 09:36

    After installing php5-gd apache restart is needed.

    0 讨论(0)
  • 2020-12-08 09:40
    sudo apt-get install phpx.x-gd 
    sudo service apache2 restart
    

    x.x is the versión php.

    0 讨论(0)
  • 2020-12-08 09:40

    In CentOS, RedHat, etc. use below command. don't forget to restart the Apache. Because the PHP module has to be loaded.

    yum -y install php-gd
    service httpd restart
    
    0 讨论(0)
  • 2020-12-08 09:42

    Install GD Library

    Which OS you are using?

    http://php.net/manual/en/image.installation.php

    Windows http://www.dmxzone.com/go/5001/how-do-i-install-gd-in-windows/

    Linux http://www.cyberciti.biz/faq/ubuntu-linux-install-or-add-php-gd-support-to-apache/

    0 讨论(0)
  • If you are like me and you are using one of the PHP Docker images as your base, you need to add the gd extension using different instructions then what's discussed above.

    For the php:7.4.1-apache image you need to add in your Dockerfile:

    RUN apt-get update && \
        apt-get install -y zlib1g-dev libpng-dev libjpeg-dev
    
    RUN docker-php-ext-configure gd --with-jpeg && \
        docker-php-ext-install gd
    

    These dev packages are needed for compilation of the GD php extension. For me this resulted in activation of GD with PNG and JPEG support in PHP.

    0 讨论(0)
提交回复
热议问题