1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved [PMMP 1.2.0] create map with picture error

Discussion in 'Development' started by KHAV, Sep 24, 2017.

  1. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Hello

    when i give to the player map with picture in PMMP 1.2.0 the console give me error:
    PHP:
    [19:19:18] [Server thread/CRITICAL]: Error"Call to undefined function MapsPic\imagecreatefrompng()" (EXCEPTIONin "MapsPic/src/MapsPic/Main" at line 35
    and this is the code that have the error:
    PHP:
    $folder $this->getDataFolder()."Image/";
    $colores = [];
    $imagen = @imagecreatefrompng($folder."Rules.png");
    in PMMP 1.1.x it was working but when i update it to 1.2.0 it give me error!

    how i can fix it?

    sorry for my bad english i am little rushing xD
     
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    You don't have the GD extension enabled. Try uncommenting it in the php.ini.
     
  3. Eduardo

    Eduardo Baby Zombie

    Messages:
    100
    GitHub:
    xBeastMode
  4. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    thank you solved!
     
    jasonwynn10 likes this.
  5. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I have this error too, but uncommenting gd extension in php.ini don't help, I'm on linux.. Where I get php with this extension then?
     
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Do not use the STFU operator EVER. I believe you imported the "@" from an example code.

    You need to install libgd-dev
     
    Sandertv likes this.
  7. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I installed libgd-dev
    Code:
    sudo apt-get install libgd-dev
    
    But it still throw the error
     
  8. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    libpng-dev I have installed too
     
  9. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Send output of
    Code:
    bin/php7/bin/php -v
    
    Code:
    bin/php7/bin/php -m
    
     
  10. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    bin/php7/bin/php -v
    Code:
    Warning: PHP Startup: Unable to load dynamic library 'php_gd2.dll' (tried: /var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/php_gd2.dll (/var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/php_gd2.dll: cannot open shared object file: No such file or directory), /var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/php_gd2.dll.so (/var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/php_gd2.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP 7.2.0RC6 (cli) (built: Nov 17 2017 20:22:50) ( ZTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
    
    and
    bin/php7/bin/php -m
    Code:
    bcmath
    calendar
    Core
    ctype
    curl
    date
    filter
    ftp
    gmp
    hash
    json
    mbstring
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    Phar
    pocketmine_chunkutils
    posix
    pthreads
    Reflection
    shmop
    sockets
    SPL
    sqlite3
    standard
    tokenizer
    Weakref
    yaml
    zip
    zlib
    
    [Zend Modules]
     
  11. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    .dll? I thought you were on linux. What does
    Code:
    ls /var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/*gd*
    
    output? Also comment back the line you uncommented.
     
  12. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I copied this line with .dll from my windows php.ini file :D What should I put instead?
    Code:
    ls: cannot access /var/jenkins_home/workspace/PHP-7.2-Linux-x86_64/bin/php7/lib/php/extensions/no-debug-zts-20170718/*gd*: No such file or directory
    
    This is output
    edit: when I commented the line again it still throw the error
     
    Last edited: Dec 29, 2017
  13. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    When I do php -i I get this about GD
    Code:
    gd
    
    GD Support => enabled
    GD headers Version => 2.1.1-dev
    
    JPEG Support => enabled
    libJPEG Version => 6b
    PNG Support => enabled
    libPNG Version => 1.2.50
    
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.